#detect if the player moves.
1 messages · Page 1 of 1 (latest)
@lusty tulip @pastel sun
Their are 2 ways to do this accurate, depending on what you want
-
Checking if
Player Get Steering DirectionisNotequal (Equals) to(0,0,0)
Player Get Steering Directionis essentially the direction the player is moving in, so if the value is not equal to(0,0,0), that means they are moving in a direction
This method will returnTrueif the player has input a direction (Like WASD or joystick, etc). Jumping or having your velocity modified via something likeVelocity Addwill not affect the result -
Checking if
Vector Get Magnitude(Get Velocity(Player))isGreater Than0
Get Velocityreturns the root velocity of the input object, for an object, its the speed the pivot point is moving, for players, its the speed their root part is moving (feet essentially)
Vector Get Magnitudereturns the "strength" of a vector, for velocity vectors, it is equal to speed in m/s
By checking if the velocity of a player is greater than 0, you will know if the player is moving at all, either manually (Input, jumping), or by force (Velocity Add, etc)
@lusty tulip
Player Head Velocity>Vector 3 Split>X>Greater Than>
Y>Greater Than>
Z>Greater Than>
Do not do this unless you are specifically looking for X/Y/Z, if you just generally want to see if the "strength" of a vector is greater than a certain value, useVector Get Magnitude. Also, for the method of detecting if a player is moving,Player Head Velocityis a bad method as it is the velocity of the head model, which is never at a speed of 0 (Unless you are flying with makerpen on screenmode)