Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

n object reference is required to access non-static member `UnityEngine.Rigidbody.AddForce(UnityEngine.Vector3, UnityEngine.ForceMode)'

$
0
0
I am a new programmer and I am trying to do this character controller P.S. I am following Youtube video. But I ran into this problem of 'object reference is required to access non-static member `UnityEngine.Rigidbody.AddForce(UnityEngine.Vector3, UnityEngine.ForceMode)'. Can someone explain to me what the problem is? I'd rather understand the problem then try to solve it myself :) thank you. Here is my code its rather simple. using UnityEngine; using System.Collections; public class PlayerMovment : MonoBehaviour { public float movementSpeed; private Vector3 input; void Start () { } void Update () { input = new Vector3 (Input.GetAxis ("Horizontal"), 0, Input.GetAxis ("Vertical")); Rigidbody.AddForce(input * movementSpeed); } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>