Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

MultiScript/Object Vs single script/Object

Discussion in 'Scripting' started by JVLVince, Mar 28, 2017.

  1. JVLVince

    JVLVince

    Joined:
    Jul 20, 2016
    Posts:
    29
    Hi Everyone,
    I wanted to clarify something about scripts on a game object, maybe some of you can answer or at least give me some hints about these problem:

    1. As the title I have a game object let say it's game managers container, and as it name, it contains all the manager's behaviours(sound, game state, server Api,...), And I plan to attach all in only one GameManager game object. But I wonder that does this way hurt performance? Or I should spit the manager to multi game objects and each game object just manage one category???

    2.And if one game object carries many scripts then how many scripts per game object is acceptable.

    Thanks for spend time read my post.
    Vince
     
  2. mumbot

    mumbot

    Joined:
    Oct 19, 2012
    Posts:
    86
    Having 1 Game Object with multiple scripts is fine. I made a game manager in one of my projects this game manager handled the creation of a planet. With in the game manager had several scripts i had around 15.
     
    JVLVince likes this.
  3. JVLVince

    JVLVince

    Joined:
    Jul 20, 2016
    Posts:
    29
    Thanks for your advice. So maybe I will do all with one game object. Because I think that manage all think in one object is better than seperate them to multi object. :D