How to determine an actor is moving up or moving down?

AlkaPPAlkaPP Member, PRO Posts: 194

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

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @AlkaPP, you can check if its self.Motion.Linear.X or Y is positive or negative. That will tell you the direction.

  • AlkaPPAlkaPP Member, PRO Posts: 194

    @Hopscotch, how can we know if it is positive or negative? Thanks

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @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"

  • SocksSocks London, UK.Member Posts: 12,822

    @AlkaPP said:
    Hopscotch, how can we know if it is positive or negative? Thanks

    Use a display tex behaviour, or maybe make a rule = if self.Motion.Linear.Y is larger than 0 then . . . .

Sign In or Register to comment.