How to determine an actor is moving up or moving down?
Hi all,
Let's say I have a ball... Hmm... no, just let's say I have an actor falling down. When it hit the ground, it move up and then fall down again. Just like it's bouncing.
My question is that how do I determine the stage (it's moving up or falling down) of the actor?
Thanks,
Comments
@AlkaPP, you can check if its self.Motion.Linear.X or Y is positive or negative. That will tell you the direction.
@Hopscotch, how can we know if it is positive or negative? Thanks
@AlkaPP
Rule Attribute self.Motion.Linear.Y > 0
"actor is moving up"
Rule Attribute self.Motion.Linear.Y < 0
"actor is moving down"
Rule Attribute self.Motion.Linear.X > 0
"actor is moving right"
Rule Attribute self.Motion.Linear.X < 0
"actor is moving left"
Use a display tex behaviour, or maybe make a rule = if self.Motion.Linear.Y is larger than 0 then . . . .