- Home /
Will using a Monobehaviour script versus a non-Monobehaviour script use less memory?
If I had an Item class that did not extend Monobehviour, how much more efficient would it be on space since it doesn't have to store Transforms, Gameobjects, Renderers, etc?
Answer by Kiwasi · Nov 08, 2014 at 07:55 PM
UA ate my answer again.
Use a MonoBehaviour on everything that needs to be attached to a GameObject. Use regular classes for everything else.
The performance difference is barely detectable, and typically not worth worrying about.
The difference is so negligible I tend to create monobehaviours for manager classes that strictly don't need to be attached to Gameobjects, just because it's convenient to see them in the scene hierarchy, change public variables via the inspector etc.
Just be aware that $$anonymous$$onoBehaviours have downsides too. Sometimes its nice to be able to create a class with new and not have to attach it to a GameObject.