Hi, I have a multiplayer authorative game, where the clients have no physics but needs the linear velocity of the body, I am currently sending the velocity from server to client, but in order to save band, I think I could calculate it locally, do anyone knows how to calculate it ? This is what I got so far, but I think I need some fixing in the calculation :
func _frameFlips(delta):
var velocityVector:Vector3 = velocityFromMesh(carMesh,delta)
var oldmpos:Utils.TVector3
func velocityFromMesh(m:MeshInstance3D, delta)->Vector3:
if(oldmpos==null):
oldmpos = Utils.TVector3.new(m.global_position)
return Vector3.ZERO
else:
var ret:Vector3 = oldmpos.vector3() - m.global_position
oldmpos.setit(m.global_position)
return ret * delta