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. Dismiss Notice

Question Question about objects and visual script

Discussion in 'Visual Scripting' started by wasdarcade, Aug 15, 2023.

  1. wasdarcade

    wasdarcade

    Joined:
    May 17, 2023
    Posts:
    7
    Hi everyone, can you please help me with this issue? My game has a character object. In the inspector of this object, I created a visual script and made control for this object with it. Also in my game there are other objects (background, various obstacles for the character). To control the behavior of these objects, I use the previously created visual script that I created in the character object inspector. Did I do the right thing? Or do I need to create a new visual script in the inspector of the object to which it relates? For example, for a character object in the inspector of this object, its own visual script. The background object has its own visual script created in the background object inspector.

    Will the fact that I do everything in one visual script affect anything?

    P.S. Sorry for the bad explanation, I'm new to Unity and it's hard for me to speak English.
     
  2. gavinprior

    gavinprior

    Joined:
    Jul 27, 2020
    Posts:
    42
    You are better off having an empty Game Object in your hierarchy (commonly called the Game Manager). This normally sets up anything you want at the start/middle/and end of the game (so you could control background; spawn objects; end animation sequence; etc), then have a seperate script (or scripts) attached to your character Game Object that do things specifically in terms of controlling it or whatever it is you want do.

    Hope that makes sense.