Hello, I need help to solve the error code BCE0020: An instance of type ‘UnityEngine.Rigidbody’ is required to access non static member ‘AddForce’
Thank you kindly correct my script:
function Update ()
{
InputPC ();
}
/ / ------
InputPC function ()
{
/ / we will put the controls right and left blocking the making of both at the same time
if (Input.GetKey (“left”))
{
/ / adding a rigid force left to be independent of the ball
rigidbody.AddForce (Vector3.right-);
}
else if (Input.GetKey (“right”))
{
/ / the same thing right
rigidbody.AddForce (Vector3.right);
}
/ / the same thing but to jump up and down
if (Input.GetKey (“up”))
{
rigidbody.AddForce (Vector3.forward);
}
else if (Input.GetKey (“down”))
{
Rigidbody.AddForce (Vector3.forward-);
}
}