so I was making a script until I wanted to compare the velocity of a player by using this:
if humanoidRootPart.Velocity <= 35 then
every time I try to do it, it gives me an error saying “Attempt to compare vector3 with <= number”
is there any alternative to comparing these?
What you’re most likely looking for is the magnitude of the velocity.
Try this instead:
humanoidRootPart.Velocity.Magnitude <= 35
Also velocity was deprecated, I recommend using GetVelocityAtPosition, which would then change the code into:
humanoidRootPart:GetVelocityAtPosition(humanoidRootPart.Position).Magnitude <= 35
2 Likes