Every GameObject that has a rigidbody, won't stay at Z 0 and I don't know why
It can be just a Sphere or a Cube. I set the position to 0,0,0 and just put a rigidbody in it (without any code) and a plane with a collider as a ground and the Z position goes crazy... The object stays where it is but the position in the editor tells me it is at Z -1......e and everytime I put the Z position in the editor to 0 again, it becomes -2....e then -3....e and so on
why is that?
Oh and when I put my simple movement code in it:
public float speed = 5f;
Rigidbody rb;
private void Start()
{
float xMov = Input.GetAxisRaw("Horizontal");
float zMov = Input.GetAxisRaw("Vertical");
rb. velocity = new Vector3(xMov, rb.velocity.y, zMov) * speed;
}
it says this after some moving around "Due to floating-point precision limitations, it is recommended to bring the world coordinates of the GameObject within a smaller range." which is weird because the sphere or box is at 0,0,0 and I move it just a bit up in the scene for example ant then I get this message.
I use unity 2020.3.21f1