player collision detectionn registering problem with an object

Hi everyone,
I am having problem with first person player collision detection. i have simply used the OnCollisionEnter function but it is not working. I have XR rigged scene and of course i would like camera to be part of the player. and as if you know if you use XR rig main camera or any camera you are using in the scene becomes the part of the XR rig. I have created an empty game object as my first person player and have made the XR rig the child of my player(which is actually the empty game object). i have attached the simple collision detection function mentioned above and want to see the collision in console but its not happening.

Im pretty sure you need a rigidbody on the player for OnCollisionEnter and OnTriggerEnter to work. Try that maybe?