Hi there, I’m having the following issue, with a video to illustrate. For some reason the character I’m working on (the bat-like one) only collides with the ghost-like and doesn’t collide neither with the player character nor with a copy of itself. All three characters have the same layer (which collides with itself), are all untagged and have rigidbodies with frozen movement and rotation (which for some reason seems to be relevant for collisions or at least triggers). For the collision check and printing I’m simply using this:
void OnCollisionEnter2D(Collision2D c)
{
print("colision");
}
For Collision both the GameObect Must be a RIgidbody and one GameObject must have a Collider component in it and attach the script on the GameObject in which you want to detect the collision.
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.name == "GIVE THE GAMEOBJECT NAME")
{
print("colision");
}
}