Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8972541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:14:27+00:00 2026-06-15T18:14:27+00:00

I want to make a main Gameobject in Unity3D that would act as a

  • 0

I want to make a main Gameobject in Unity3D that would act as a command center for anything related to controls so that any component in the game that needs to know if the player is trying to go right would get a notification or a state change and act accordingly. I am kind of new to programming and scripting in Unity, so I know this is possible, but I don’t know how to do it specifically with the engine.

A few concepts I came across are:

  • state changing techniques
  • Singleton God classes
  • Parent GameObject with children that send messages upwards and receive them downwards
  • Inheritance of abstract classes that act as interfaces and get implemented into some collection and iterated through to get the message called on

If you guys have any insights on this subject that would be great. I basically want to find out what’s a good approach for this problem, how to decide on a good one (Pros vs. Cons) or if I got it all wrong. 🙂

All I am looking for is an implementation example of your method of choice that worked for this purpose. No need to go into each separate method. Maybe a brief description of why you decided on your pattern would be great!

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:14:29+00:00Added an answer on June 15, 2026 at 6:14 pm

    Well, you may use a C# events:
    1) Create your CommandCenter class (MonoBehaviour), implement there some events you need to share, and make some public methods to call tham.
    2) whenever you handle a button player press, call the method in CommandCenter, that calls an event (or, you may just make events public and call tham directly)
    3) In each component, witch should know about some event, in Awake method, do the following:

    var commandCenter =  FindObjectOfType(CommandCenter);
    commandCenter.MyEvent += localMyEventHandler;
    

    4) don’t forget to unsubscribe for events on destroy:

    OnDestroy ()
    {
    var commandCenter =  FindObjectOfType(CommandCenter);
    commandCenter.MyEvent -= localMyEventHandler;
    }
    

    5) So, in localMyEventHandler method you can handle this event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a loop that in my main.xml creates a button for
I want to make it in such a way that I get: Main |
want to make an Android app that starts with a main layout and when
I want to make my Java EE application pluggable. The main application would be
I want to make a TV window that consists of one main JPanel (
I have a main domain MYDOMAIN.COM I want to make it easy for me
My search system has two main parts: index and search. I want to make
I want to make an app for iPhone and Android. The main activity will
I want to make an application that is similar to the World of warcraft
I want to make an Application that only has a NotifyIcon. It doesn't need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.