Why does not work? C# Unity C# Unity Game Developer 2D Lesson 37

Logically, the game should end when my character’s head comes into contact with Gorund in the 37th lesson. But there is a problem in the teacher script file:
void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == “Ground”)
{
Debug.Log(“Ouch, hit my head”);
}
}
It says this way. But this use is possible between objects passing through it. When I watch it in the video, it writes this code, but when our head touches the Ground, it does not intertwine, it jumps. How is this possible?
My codes are as follows:



This has been mentioned in many posts. Rick’s character appears to have another circle collider that is not a trigger, but it’s never mentioned because I think it wasn’t supposed to be there

1 Like

Ohh okey. With some effort, I solved the problem in my own way. Thank you for the answer.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms