Check If Velocity is less than

themagicboxthemagicbox Member, PRO Posts: 82
How do i check if an actors velocity is less than a certain amount, do a rule...

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    You could do something like this:

    Rule:
    When attribute self.Motion.Linear Velocity X (or Y) .....

    You can also put in a condition for the Angular Velocity.
  • ORBZORBZ Member Posts: 1,304
    Define attribute speed (real)

    Constrain speed = magnitude(linearVelX, linearVelY)

    Rule: speed < minimum
    - do stuff

    You can do this without a constraint like this:

    Define game.ZERO = 0

    Rule game.ZERO < minimumSpeed - magnitude(linearVelX, linearVelY)
    - do stuff
Sign In or Register to comment.