Answers for "oncollisionenter is declared but never used"

C#
1

oncollisionenter is declared but never used

//The problem is that you need to move this out of a void [e.g. void Start() or void Update()] 

void OnCollisionEnter(Collision collision)
    {
        if (other.gameObject.tag == "Object") 
         {
             Debug.Log ("Collided");
         }
    }

//Also same with OnCollisionEnter2D, OnTriggerEnter and OnTriggerEnter2d
Posted by: Guest on February-22-2021

Code answers related to "oncollisionenter is declared but never used"

C# Answers by Framework

Browse Popular Code Answers by Language