Hi, I'm trying to get a script and block combination to work to switch screens but it just says " Can't add script behavior Assambalyinfo.cl The script needs to derive from MonoBehavior! " how do I fix it? This is the code I have. I'm using Microsoft visual studio to code Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement public class SceneSwitch : MonoBehaviour { void Ontriggerenter(Collider other) { SceneManager.LoadScene(1); } }
This script's filename needs to be exactly "SceneSwitch.cs". You're getting an error with another filename, so it either is another script that is causing the problem or you have this script saved with the wrong filename. Also, your OnTriggerEnter will not be called because you have incorrect capitalization. Capitalization is important in C#.
I have checked the name and it is as it is supposed to but it is still not working. I'm using the 3d game kit and can't find what script may cause it.