I have 2 sprites, one with a rigid body and a box collider, and another with just a box collider. When they touch, the OnCollisionEnter2D doesn’t fire, any idea why? First image is of the ‘Player’ and the second one is of an obstacle. The green box highlighting the sprite goes all around it
This is the code I’m using
using UnityEngine;
using System.Collections;
public class KillScript : MonoBehaviour {
void OnCollisionEnter2D(Collision2D hit) {
Debug.Log (“Game Over!”);
}
}
and the player is being moved with velocity, the obstacle doesn’t move