Stopping actors
chrisal
Member Posts: 74
Hi all,
Over the last week or so I have been playing aroung with drag and friction. The purpose is to stop actors and stop them from rotating. It is qute difficult to explain so I have found a couple of examples to explain.
If you look at code monkeys pool demo, the balls keep on moving ever so slightly after the shot is played, thas is the problem with my game at the minute....
But if you look at obstacle pool http://gamesalad.com/game/play/29821 and play a shot the balls come to a nice natural looking stop.
Can please please please somebody explain how this can be achieved, I have been trying to solve this for almost two weeks now and it is starting to stress me out.
Many thanks
Chris
Over the last week or so I have been playing aroung with drag and friction. The purpose is to stop actors and stop them from rotating. It is qute difficult to explain so I have found a couple of examples to explain.
If you look at code monkeys pool demo, the balls keep on moving ever so slightly after the shot is played, thas is the problem with my game at the minute....
But if you look at obstacle pool http://gamesalad.com/game/play/29821 and play a shot the balls come to a nice natural looking stop.
Can please please please somebody explain how this can be achieved, I have been trying to solve this for almost two weeks now and it is starting to stress me out.
Many thanks
Chris
Comments
I can put a rule on to "move = 0 velocity " but I have nothing to adhere that to. What monitors the motion? I need the ball to move, slow down then stop completely. I i set the rule to use motion velocityX or y it goes both + and - depending where you shoot so saying less/more than an amount doesn't work as a trigger.
This shouldn't be this hard for something so simple. As I have scoured the forums already I hope someone knows a solution.
*********
http://www.singlesparq.com
rule speed < 10
Move angle: 0, speed: 0 (stacked)
EDIT: SORRY only read the move part for some reason not your first bit - checking (tired). Thanks for your help!
rule where all: speed < 10 and self.time > 0.1
welcome
i'm not sure why it didn't work for you. when the ball first spawns, it's speed is 0, so to avoid the rule triggering when the ball first spawns having an additional condition in the rule that says when self.time (not to be confused with game.time) is greater than some initialization timeout should work. (i used 1/10th of a second in my example, depending on the situation you may need to bump that up to a half a second)
Either way, glad you got it to work!