a field initializer cannot reference the nonstatic field method or property 'Component.GetComponent<Rigidbody>()'
问题 I have no idea what is going on, I am trying to follow a tutorial that was written in Unity 4 and a lot has changed. This is as far as I have gotten and now I am stuck. public class PlayerMovement : MonoBehaviour { public float moveSpeed; public static Rigidbody rb = GetComponent<Rigidbody>(); private Vector3 input; // Use this for initialization void Start() { } // Update is called once per frame void Update() { input = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));