I am modifying the Delivery Driver project and want to create multiple collision responses based on the objects which are colliding. Currently I have 3 object types: Wall, Crate and Man. Each pairing should log a different message to the console. Here is my current wall collision script:
public class WallCollision : MonoBehaviour
{
void OnCollisionEnter2D(Collision2D other)
{
Debug.Log("Ouch!");
}
}
I attempted to use Tags to achieve this but intellisense is telling me that “Collision2D does not contain a definition for tag”
How can I improve this to send the message “Thud” when a Crate collides with the wall?