Controlling an actor's movement with other actors
daniel.robert.campbell
Member Posts: 251
I'm officially at a dead end.
I have a crosshair on screen used for aiming. I need it to move left and right, and ONLY left and right (not up and down). I have a left arrow, and a right arrow to do so. When each is pressed, I have a rule that when (Touch inside + Touch pressed) they change a "move crosshair left" or "move crosshair right" attribute to +1.
I also have an additional rule on each arrow that is (touch inside + touch released) causes those same attributes to -1.
On the Crosshair I have a rule that says if "move crosshair left/right" is > 0, accelerate left/right. The crosshair does this, but it will not stop when the arrow is released.
If the crosshair is still in motion and I press the opposite arrow (moving left, I hit the right arrow) then the crosshair will stop, but will not respond after that.
Any advice I could get would be GREATLY appreciated. Thank you for your time.
I have a crosshair on screen used for aiming. I need it to move left and right, and ONLY left and right (not up and down). I have a left arrow, and a right arrow to do so. When each is pressed, I have a rule that when (Touch inside + Touch pressed) they change a "move crosshair left" or "move crosshair right" attribute to +1.
I also have an additional rule on each arrow that is (touch inside + touch released) causes those same attributes to -1.
On the Crosshair I have a rule that says if "move crosshair left/right" is > 0, accelerate left/right. The crosshair does this, but it will not stop when the arrow is released.
If the crosshair is still in motion and I press the opposite arrow (moving left, I hit the right arrow) then the crosshair will stop, but will not respond after that.
Any advice I could get would be GREATLY appreciated. Thank you for your time.
Comments
And heres the real answer to your question lol. When you use accelerate and dont apply drag, the acceleration happens until its reach its top speed, So if you have accelerate speed 100 and you let go of the button before the speeds 100 it will keep acelerating until it reaches 100. So just use move and make it relative to scene and youll be set.
I'll let you know how your advice turns out though. Thanks!
Is there a cleaner way to handle this type of behavior? A more reliable way that might not result in bugs?
Sorry I'm such a noob. And thanks again to JohnPapiomitis.