I have this error.
can someone help me? Thanks in Advance.
using UnityEngine;
using System.Collections;
public class PlayerMove : MonoBehaviour {
public float speed;
public float backSpeed;
public float jumpVelocity;
private bool isGrounded;
void Awake(){
Rigidbody rigid = GetComponent<Rigidbody>();
}
void Start(){
}
void Update(){
if(Input.GetButtonDown("Jump")){
if(isGrounded){
rigidbody.AddForce(jumpVelocity, ForceMode.VelocityChange);
isGrounded = false;
}
}
}
void FixedUpdate () {
if(isGrounded){
if(Input.GetKey(KeyCode.W)){
rigidbody.AddForce(0f, 0f, backSpeed, ForceMode.Acceleration);
}
else if(Input.GetKey(KeyCode.S)){
rigidbody.AddForce(0f, 0f, backSpeed, ForceMode.Acceleration);
}
}
}
}