K so I'm making a trebuchet with a grabber that picks up the ammunition. On the main beam of the trebuchet I have a gyroscope, so that when the beam's angle exceeds 45 degrees, the grabber releases.
I've fiddled around with how to get the grabber to work for several hours now. At the moment, I have a 1x1 PHX plate with a negative forcer attached to the middle, and a grabber just next to the negative forcer. I've linked the grabber to the plate.
I have the negative forcer wired to the following expression gate:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-spacere;overflow:auto'>Button == 0 & Pitch < 45 -> Force = 100000;
Button == 0 & Pitch > 45 -> Force = 0;
Button == 1 & Pitch < 45 -> Force = 100000;
Button == 1 & Pitch > 45 -> Force = 0;
Button == 0 & Pitch < 45 -> Velocity = -100;
Button == 0 & Pitch > 45 -> Velocity = 0;
Button == 1 & Pitch < 45 -> Velocity = -100;
Button == 1 & Pitch > 45 -> Velocity = 0;</div>
That seems to be working (it pulls in whatever object i put in range of it).
Then, I have the grabber wired to the following expression gate:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-spacere;overflow:auto'>Button == 0 & Pitch < 45 -> Strength = 100000;
Button == 0 & Pitch > 45 -> Strength = 0;
Button == 1 & Pitch < 45 -> Strength = 100000;
Button == 1 & Pitch > 45 -> Strength = 0;
Button == 0 & Pitch < 45 -> Grab = 1;
Button == 0 & Pitch > 45 -> Grab = 0;
Button == 1 & Pitch < 45 -> Grab = 1;
Button == 1 & Pitch > 45 -> Grab = 0;</div>
If you're asking yourself why I have the button in the code at all it's because for some reasonI was going back and forth in my head whether it needed to be there or not to prevent it from grabbing any part of the trebuchet after it had released(im a bit spacy today) and I figured it wouldn't hurt if it was there.
Anyway... I'm not sure if the grabber is doing anything or not... but I do know that the negative forcer pulls the object in. But, when I release the trebuchet, the object gets released pretty much right away (I'm positive that the beam hasn't hit 45 degrees yet when it gets released).
Anyone know what I'm doing wrong? I've never worked with forcers or grabbers before so I've just been doing trial and error.


LinkBack URL
About LinkBacks
re;overflow:auto'>Button == 0 & Pitch < 45 -> Force = 100000;



Reply With Quote


i can't try it now cuz i gotta go but I'll try it as soon as possible. 

Bookmarks