Hello again!

I've ran into an issue using variables to activate game objects from schematics, which is probably due to my noobiness knowledge of how to handle variables properly.

So I added a game object (some particle effects) to my combatants and I want to activate that game object with a schematic. I remembered the gameplay tutorial with the trap door, so I tried to do something similar: I added a Game Object Manager component to my character, and I created a bool variable to activate or deactivate it. For example, when a character moves, I want the particle effect to work for that specific character. So I modified the grid move schematic to set to true that bool variable, and to set it to off when the character stops moving.

My problem is that I'm unable to activate the particle effect for a specific character. My schematic works for either all characters at the same time, or none of them.

In most Ork battle tutorials I've done, the variable origin for the active character is the machine object, but in the Game Object Manager, I can't seem to select machine object as the origin. I also tried to use Scene Name like the in the trap door tutorial, but it didn't work either.

However, when I set the variable origin to global, it works, but the particle effect activates for all characters on the battlefield, not only for the moving one (I knew it'd do that, but at least I know the rest of my schematic works and that I only need to find how to have the schematic tell a specific Game Object Manager to set its variable to true/false).

I apologize for the long explanation... :s

Thank you!

  • edited March 2022
    The User is the manager's game object, so using Object variable origin and the User object will use object variables on it. Via the Scope setting you can also get object variable components on parent or child objects of the manager.

    Anyway, you can also directly enable/disable game objects without using game object managers using an Activate Object node.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Oh, I didn't know there was a node for that. I guess it'll be faster that way.

    I'll try this out later this week when I have time. Thanks for the reply!
  • Hi again!

    I apologize, I haven't been able to get this to work with either method.

    With the variable method, in the game object manager component in the prefab, I can have ''Variable Origin: Object'' and ''Game Object: User'', but in the schematics, when I select ''Variable Origin: Object'', there's no User in the Game Objects list. I tried selecting a few Game Objects in the schematic (Machine Object, Starting Object and Selected Object), but it didn't work.

    As for the Activate Object node, it seems simple enough, but... how can I start the battle with a specific game object on all combatants deactivated?

    Sorry for the trouble!
  • In schematics, the user is the Machine Object (i.e. the game object the machine is running on when coming from a machine component) - where is your schematic used?
    Also, keep in mind that the game objects actually need to use object variable components. If it's a combatant's game object, you can enable automatically using them via the combatant's settings (or general settings for all combatants).

    As for the disabled game object - if that's the default state for the game object, I'd recommend to just have it disabled on your combatant prefabs and enable it (via the Child Object path) when needed.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ok, thank you, I've been able to make this work. I completely forgot about creating an object variable in the combatants. I guess I was trying, in the schematic, to activate a variable that wasn't created yet in the combatant.

    Thank you for your time!
Sign In or Register to comment.