playMaker

Author Topic: HOW TO CHECK IF A CAR IS STOPPED  (Read 1978 times)

wallaceb68

  • Junior Playmaker
  • **
  • Posts: 87
HOW TO CHECK IF A CAR IS STOPPED
« on: October 29, 2013, 10:44:04 AM »
I am trying to figure out how to check if a car has came to a stop. and if so do this***** if not do *******

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: HOW TO CHECK IF A CAR IS STOPPED
« Reply #1 on: October 29, 2013, 11:14:55 AM »
How do you move the car ?
If you use iTween you can fire an event on finish.
If you use unity pathfinding you can use GetRemainingDistance and then also fire an event when arrived
You can check the distance between the car and the stop, if you know their location, with a Get Distance action.
Maybe you can check the velocity of the car ?
Or you can check if its position changed over time ?
......
....
..
Depends on your setup
« Last Edit: October 29, 2013, 11:16:39 AM by Yanifska »
Visit my portfolio: http://www.yanivcahoua.com/

redikann

  • Full Member
  • ***
  • Posts: 174
Re: HOW TO CHECK IF A CAR IS STOPPED
« Reply #2 on: October 29, 2013, 11:20:18 AM »
If you have a rigid body you might want to get the property RidgidBody->Velocity->Magnitude. That should be greater than zero with movement in any axis or 0 if stopped. Then you could do a float compare or set a bool and use the bool state to perform logic.