I have a ball that moves and i want it to move in direction my camera faces when I rotate camera how would I achieve this ?
movement script atm
var speed : float = 3.0;
function Update () {
if(Input.GetButton("Forward")){
rigidbody.AddForce (0, 0, speed);
}
if(Input.GetButton("Backward")){
rigidbody.AddForce (0, 0, -speed);
}
if(Input.GetButton("Left")){
rigidbody.AddForce (-speed, 0, 0);
}
if(Input.GetButton("Right")){
rigidbody.AddForce (speed, 0, 0);
}
}