Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to measure velocity in one direction?

Asked by
NsNidPL 41
5 years ago
Edited 5 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

Hello. I am making a VehicleSeat-based driving system for road vehicles. The problem is, when the vehicle turns, the speed changes because it uses Velocity.Magnitude. How do I measure speed in one direction using lookVector or something else?

sp = s.Velocity.Magnitude

1 answer

Log in to vote
0
Answered by
NsNidPL 41
5 years ago

Figured it out myself:

sp = (s.Velocity * s.CFrame.LookVector).Magnitude
Ad

Answer this question