LoginSignup
0
1

More than 1 year has passed since last update.

【Unityメモ】The script don't inherit a native class that can manage a script.

Posted at

Unity上で新しい C#スクリプトを作成し、オブジェクトにアタッチしようとしたら以下のエラーが出た。

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

調べると、スクリプト名とクラス名が一致していないことが原因とわかったが、何度確認しても二つが一致している。

Hoge.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Hoge : MonoBehaviour
{
    private void Start()
    {
        Debug.Log("Start");
    }
}

スクリプトの作り直しやアタッチし直しをしても治らず。

結果、全く別のスクリプトのエラー(セミコロンつけ忘れ)が原因だった。

エラーを読んでも修正箇所がわからなかったのでメモ。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1