public class CONTROL : MonoBehaviour
{
public float amount = 10f;
void Update()
{
float v = Input.GetAxis("Vertical")*amount*Time.deltaTime;
float h = Input.GetAxis("Horizontal")*amount*Time.deltaTime;
rigidbody.AddTorque(transform.right*v);
rigidbody.AddTorque(transform.forward*h);
}
}
This is my script for applying torque to a cube.
when I run this and press a key it does nothing but show me this message:
“transform.position assign attempt for ‘Cube’ is not valid. Input position is { NaN, NaN, NaN }.”
This is my second question, thanks for all the answers I have received but none have worked yet.