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

Error CS 0120: an object reference is required to access non-static member 'UnityEngine.Transform.Rotate(UnityEngine.vector3)'

$
0
0
I am a beginner in scripting and was following a tutorial on how to add controller support to a VR game in unity. when trying to enter playmode I get this compiler error (the title of my question). This is the script : using UnityEngine; using System.Collections; public class testcontrol : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { if (Input.GetButtonDown ("fire1")) { Transform.Rotate(Transform.rotation.eulerAngles + new Vector3 (0f, 0.1f, 0f)); } float h = Input.GetAxis ("Horizontal"); float v = Input.GetAxis ("Vertical"); transform.position += new Vector3 (h * 0.1f, v * 0.1f, 0f); } } Any help or advice is much appreciated.

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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