Home > Enterprise >  Statement not printing after colliding with an object
Statement not printing after colliding with an object

Time:07-08

I made a collision in my game, which is supposed to print Hello after colliding with an object. Instead, it does nothing but does not show any errors. Does anyone know how to fix this?My game

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class kill : MonoBehaviour
{
    void OnTriggerEnter2D(Collider2D other)
    {
        print("hello");
    }


}

CodePudding user response:

You can check docs for what needed to trigger those events at here. You're probably missing some little details.

  • Related