unity you are trying to create a monobehaviour using the 'new' keyword code example
Example: unity you are trying to create a monobehaviour using the 'new' keyword
// Instead of this:
MyScript script = new Script();
// Do this:
MyScript script = obj.AddComponent<MyScript>();