Collision detection problem

hello.
I have made a program to detect collisions between my character and an enemy I think I have done everything right but when I detect nothing normally happens it sends a message to the console telling me what it has touched but there is nothing ```
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class playerMovement : MonoBehaviour
{

void OnCollisionEnter(Collision col)
{
Debug.Log(“Debug 1 : Il y a collision”);
Debug.Log(“Debug 2 : Le nom de l’objet qui rentre en collision = ->” + col.gameObject.name + “<-”);

}
}

Both your objects need to have colliders. At least one of them needs a rigidbody.

1 Like