(Before replying please read ALL of this)
I’m trying to make a camera effect for when you are moving at a certain speed. How would I track the speed at which the player is falling, the speed at which the player is moving forwards, etc. More specifically, how would I track specific variables in velocity? Such as Y-axis velocity.
(not walkspeed)
Hi, this is my first reply so I hope it helps. Parts have a Velocity property that can be read off of, if you read it off of the Humanoid Root Part then you will have an accurate velocity.
Character.PrimaryPart.AssemblyLinearVelocity
is a Vector3 value, which contains information about the character’s movement speed (and direction) in the X, Y, and Z axes.
To determine the vertical velocity, you would simply use Character.PrimaryPart.AssemblyLinearVelocity.Y
To determine the speed at which the player is moving forwards, I’m assuming you’re referring to the non-vertical component of the velocity, so it would be Character.PrimaryPart.AssemblyLinearVelocity * Vector3.new(1, 0, 1)
(essentially neglecting the Y-component by multiplying it by 0)
If you wanted to find the scalar (non-vectoral) speed at which the character is moving, you can use the magnitude of that velocity, so the speed would be (Character.PrimaryPart.AssemblyLinearVelocity * Vector3.new(1, 0, 1)).Magnitude
.
Wait what about?
PrimaryPart.AssemblyLinearVelocity.Magnitude
Does it work too?
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.