Unity The script don't inherit a native class that can manage a script

Viewed 781

I have just opened up unity on a blank project and I am trying to link a script to my player object(I am using something from the asset store) and when I try to connect them I get the error: The script don't inherit a native class that can manage a script.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}

I cant figure out why it is saying this.

2 Answers

Make sure the public class name PlayerController in the script is the same as the name of the script file: PlayerController.cs.

This might work for you.

if you changed script name after creating it, you should delete and create again. I met same problem and I solved it this way.

Related