Hi,
Im wondering about something I am doing that is causing this well known warning:
> You are trying to create a> MonoBehaviour using the 'new' keyword.> This is not allowed. MonoBehaviours> can only be added using> AddComponent(). Alternatively, your> script can inherit from> ScriptableObject or no base class at> all.
I am well aware that the solution to this would be to simply use AddComponent< T>, However in my case the place I am getting this error is when running my [test] functions. And what I am creating is:
GameObject actor; actor = new GameObject();
Im wondering if there is any other way that I could possibly create gameObjects without incurring this logwarning?
Im wondering about something I am doing that is causing this well known warning:
> You are trying to create a> MonoBehaviour using the 'new' keyword.> This is not allowed. MonoBehaviours> can only be added using> AddComponent(). Alternatively, your> script can inherit from> ScriptableObject or no base class at> all.
I am well aware that the solution to this would be to simply use AddComponent< T>, However in my case the place I am getting this error is when running my [test] functions. And what I am creating is:
GameObject actor; actor = new GameObject();
Im wondering if there is any other way that I could possibly create gameObjects without incurring this logwarning?