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

An object reference is required to access non-static member `UnityEngine.Animation.Play()'

$
0
0
Hello im getting this error An object reference is required to access non-static member `UnityEngine.Animation.Play()' there is my code public class BottleControl : MonoBehaviour { Rigidbody rb; bool touched = false; Vector3 curPos; // Use this for initialization void Start () { rb = GetComponent(); } // Update is called once per frame void Update () { if (Input.touchCount > 1 && touched == false) touched = true; else touched = false; if (touched || Input.GetMouseButtonDown(0)) { curPos = transform.position; if (curPos.y < 5f) { rb.AddForce (new Vector3 (0, 1000, 0)); Animation.Play (); //rb.AddTorque (new Vector3 (400, 0, 0)); } } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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