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

error CS0120: An object reference is required to access non-static member `UnityEngine.Behaviour.enabled'

$
0
0
,Hello, please help me. I am not the brightest at C# so my code has a lot of bugs. Usually I get them fixed but now I can't fix it. Can you fix it please? *Error Message: error CS0120: An object reference is required to access non-static member `UnityEngine.Behaviour.enabled'* using UnityEngine; public class PlayerCollision : MonoBehaviour { public static BoxMovement movement; void OnCollisionEnter (UnityEngine.Collision collisionInfo) { if (collisionInfo.gameObject.CompareTag("Obstacle")) { BoxMovement.enabled = false; } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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