Tell if actor is moving.

Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
edited November -1 in Working with GS (Mac)
Hey guys,

I would like to know if there is a way to know, in-game, if an actor is moving. Is this possible?
I have searched the forums and I couldn't find anything.

Thanks for your time,
Bray

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yep just check the linear velocity

    if linear velocity x is 0 your players not moving at all on the x, if its greater then 0 hes moving right, if its a negative and less then 0 hes moving left

    if linear velocity y is 0 your players not moving on the y at all, if its greater then 0 hes moving up and if its a negative and less then 0 hes moving down

    hope that helps
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Hey thanks John!
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Okay, it's not working.

    What I want is when a ball isn't moving anymore, then i want it to be unmovable.

    So here is what I have:

    Rule: When attribute self. linear velocity x is 0 and when linear velocity y is 0:

    Change attribute self.Physics.movable TO false.

    But they still move when another ball hits it.
    Any idea why?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    its not working because you cant change the moveable attribute in game

    constrain the linear motion x and y to 0 if you want it to become not moveable

    or record the position you want it to stay at and constrain the self position x and y to those cordinates
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Alright, ill try that. Thank you.
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Nope, that doesn't work. They look like they are being hit when they are not.
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    What I am after is you shoot a ball, where ever, and when it stops moving, I want it to be grounded, so it doesn't move anymore.
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Or I might be constraining it wrong.
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Bumping.
Sign In or Register to comment.