The script needs to derive from MonoBehaviour!

I was looking for some help with the 2d course on my first code

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

public class helloworld : MonoBehaviour {

	// Use this for initialization
	void Start () {
        print("hello world");
	}
	
	// Update is called once per frame
	void Update () {
		
	}
}

Can’t add script behaviour TMP_CoroutineTween. The script needs to derive from MonoBehaviour!

1 Like

Generally this is due to mismatch between file name and class name.
Don’t know for sure c# but in unity the file.cs must have the same name as your class.

MyFile.cs

public class MyFile : MonoBehaviour …

1 Like

Thank you

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms