- Home /
Question by
AdhesivePriority · May 11, 2020 at 08:24 AM ·
bugerror message
error CS0120: An object reference is required to access non-static member `UnityEngine.Behaviour.enabled'
,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;
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Looking for help with Assertion failed on expression: 'task.computeData.buffer == NULL' 0 Answers
Unity does a BSOD during install - Need help troubleshooting cause 0 Answers
Blacksmith Environment 'Profiler' error? 3 Answers
Load and switching level problem 0 Answers
how do i fix this error? (textmeshpro version 2.1.6) 0 Answers