Every time i jump the player disappears off the screen and in the inspector the Transform Position Y changes at alarming rates. I also get this message in the Inspector Transform tab - “Due to floating-point precision limitations, it is recommended to bring the world coordinates of the GameObject within a smaller range.” What does this mean?
Heres the source code if it helps:
using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour
{
public float moveSpeed = 7f;
public float turnSpeed = 150f;
public float jumpSpeed = 0.25f;
void Update ()
{
if(Input.GetKey(KeyCode.W))
transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
if(Input.GetKey(KeyCode.S))
transform.Translate(-Vector3.forward * moveSpeed * Time.deltaTime);
if(Input.GetKey(KeyCode.A))
transform.Rotate(Vector3.up, -turnSpeed * Time.deltaTime);
if(Input.GetKey(KeyCode.D))
transform.Rotate(Vector3.up, turnSpeed * Time.deltaTime);
//jump test
if (Input.GetKey (KeyCode.Space) && !Gravity.boolGravity) {
rigidbody.AddForce(Vector3.up * jumpSpeed);;
Gravity.boolGravity = true;
}
}
}