#detect if the player moves.

1 messages · Page 1 of 1 (latest)

pastel sun
#

Easiest way I can think of doing it is
If player velocity is greater than 0 (or a value close to 0 to account for VR players head movements) then Respawn player.

lost gate
#

@lusty tulip @pastel sun

Their are 2 ways to do this accurate, depending on what you want

  1. Checking if Player Get Steering Direction is Not equal (Equals) to (0,0,0)
    Player Get Steering Direction is 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 return True if the player has input a direction (Like WASD or joystick, etc). Jumping or having your velocity modified via something like Velocity Add will not affect the result

  2. Checking if Vector Get Magnitude(Get Velocity(Player)) is Greater Than 0
    Get Velocity returns 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 Magnitude returns 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, use Vector Get Magnitude. Also, for the method of detecting if a player is moving, Player Head Velocity is 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)