Hi, I am trying to add the velocity of my gun at the instance of shooting, to the velocity of my bullet, So that the bullet will move the same speed relative to the gun, regardless of the velocity of the gun. To do this, I am accessing the rigidbody.velocity of my gun and adding it to the rigidbody.velocity of my newly instantiated bullet. . However, the velocity of the gun always returns as 0, even though it is being moved (by the mouse, and by kinematic Player characters movement through WASD). SO it seems because im moving the gun by means other than rigidbody.addFoce(), I will need to calculate the velocity of the gun myself. But is there another way? whats the easiest way to get the velocity of a gameobject?
Calculate or get the object current position and substract from the last frame position and that’s the velocity approximation.