Actually I need to calculate some networked objects to animate correctly, to make that, i need the speed of the object, but with lag the animations dont match, so i want to get the “local” speed of the object.
In my case this object dont have a RigidBody component, the network movement is updating using transform.position, so I dont have speed value to read.
What i want, is calculate the object “forward speed” based on the looking direction, the problem is, the transform. position change between many values when the gameobject move in the word, changing X and Z from positive to negative and back based on look direction (world coordinates).
I dont found a way to get the “moving forward speed” if the player is changing always the coordenates (imagine the player doind a “S” movement always), maybe comparing the previous frame transform.position with the transform.forward and check the % diferences to get the “forward” diference, but dont know…