Im currently making a speed gun like feature for one of my games, and I was wondering how would I get an objects speed? as in how fast they’re moving. Note that the object doesn’t have a body velocity instance
1 Like
You might need to do some math. Speed it calculated by the distance and time. So if you cast 2 rays through the speed tracker and when it goes from the first ray to the second ray, figure out the time. Maybe use “Studs per Hour” or something.
Please note I have never done this before and this is just a suggestion. Idk if it would be accurate.
If the object’s speed is determined by the physics engine, the code would be as simple as:
local speed = object.Velocity.Magnitude
The unit of measure would be in studs per second by the way.
9 Likes