Calculating speed of plane (which method below is better)


I am working on calculating the speed of my plane. Below are my two methods that I have.

local methodOne = ((self.LastPosition-self.Main.Position).magnitude/(time()-self.LastTime))
local methodTwo = self.Main.Velocity.Magnitude

I have seen it done both ways. Can someone tell me what the differences and the trade-offs between the two would be? Thanks!

Oh uh… BasePart.Velocity got deprecated…

use BasePart.AssemblyLinearVelocity

Okay, so what’s the difference in that method and the other one I listed? (method one)

The difference is that the first method is basically manually checking the speed by using part.lastposition which is the part’s last position, waits for a number of seconds, then checks the current position to find out how much distance travelled in the waited amount of time. then it uses a velocity formula to calculate the velocity.

Damn, alot of explaining

1 Like

I get that, but does either method have a benefit over the other?

Also, I am having issues with getting the AssemblyLinearVelocity magnitude. I saw it doesn’t replicate? I’m trying to retrieve it from the server, and the client is the network owner of the plane.

ah, then the other one is the best option.

the assemblylinearvelocity is simple and easy to do, while the other method is more accurate but is a bit less efficient.