Collision Detection

I am trying to write a script that reloads the scene when the player collides with certain obstacles. Here is my code and the error I get in Unity.
Script error: OnCollisionEnter
This message parameter has to be of type: Collision
The message will be ignored.

    using System.Collections;
    
    using System.Collections.Generic;
    
    using UnityEngine;
    
    using UnityEngine.SceneManagement;
    
    public class Obstacle : MonoBehaviour
    {
        //using UnityEngine.SceneManagement;
        //SceneManager.LoadScene("level1");
    
        void OnCollisionEnter(Collision collision)
        {
         
            if (collision.gameObject.name == "obstacle")
            {
                SceneManager.LoadScene("level1");
                
            }
        }
    }

@crazykiller367
did you assign a Collider component to you both of you Object? Player and obstacle

wait
who are you assigning this script to??

its name is Obstacle so that means you are assigning this to obstacle?

its not gonna work. you want to load another scene when the player collides with the obstacle.

if it is not on the player it is not gonna work.

try using

  if (collision.gameObject.name == "player") {
      //then load the scene
  }

and i recommend using tags instead of name. and also check any spelling mistakes