Empty gameobject just to hold scripts?

Would it be a bad practice to create an empty game object for the sole purpose of holding lots of generic scripts?

If it’s ok, Is there anything to consider when doing this?

Examples scripts that the gameobject would hold.

  • All UI interaction and animation
  • Global timer
  • Scene loading
  • Character controller
  • Events

Would it be a bad practice to create an empty game object for the sole purpose of holding lots of generic scripts?

Not at all. That sounds like a great idea to me!

Out of the scripts you mentioned, I’d usually rather attach a character controller to the character it’s controlling. Other than that, though, all of those things could reasonably be global, either to a scene or in some cases even across multiple scenes.

For truly global objects such as game controllers and the like, you might consider singleton patterns that can automatically initialize the controller the first time it is referenced.

It’s generally good practice (not just in Unity) to place all code logic as close as possible to the thing to which it relates. So character controllers should be on characters, enemy AI should be on enemies etc. If you have generic global game controllers, make a generic game controller object (I.e. The empty Gameobject you describe) and attach them to that. It’s perfectly good, and very common practice.