Answer the question
In order to leave comments, you need to log in
Why doesn't OnCollisionEnter/OnTriggerEnter work?
I created an empty project. I added a cube and threw a RigidBody and a Box Collider on it. I added a second cube, and threw a Box Collider on it.
I made a script and hung it on the first cube (I also tried on the second one):
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test : MonoBehaviour
{
void OnCollisionEnter()
{
print("hit");
}
}
Answer the question
In order to leave comments, you need to log in
1. If 2d game - need OnCollisionEnter2D
2. need rigetbody 2d or normal, depending on the collider
3. Need input arguments.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question