hi, im trying to make a rolling ball game, the ball moves with respect to the axis of the world (xyz) I want the ball moves forward when the camera rotates
this is the ball script
var fuerza = 10;
function Update () {
if (Input.GetKey("up"))
rigidbody.AddForce(Vector3(0, 0, fuerza));
if (Input.GetKey ("right"))
rigidbody.AddForce(Vector3(fuerza, 0, 0));
if (Input.GetKey ("down"))
rigidbody.AddForce(-Vector3(0, 0, fuerza));
if (Input.GetKey ("left"))
rigidbody.AddForce(-Vector3(fuerza, 0, 0));
}
Just for a point of reference, when the class isn't derived from <i>MonoBehaviour</i>, it's not necessary for the class and script (*.cs file) to have the same name.
– Eno-KhaonNope. That was the only error that popped up
– Glass_Egg_02