Is it possible to access a gameObject + the component in a battle-startEvent? I just find out how to use the camera or the actors to use "Call function" or "Enable Component".
This time I have a script in my scene, which will disable all Combatants which are not in battle. Looking in the tutorials I found the Combatant Handler to this, but I am not sure how to start it when battle starts (and of course enabling the combatants again when battle ends).
To get all combatants (excluding the player group) that are not dead and not in battle: List<Combatant> combatants = ORK.Game.Combatants.Get(false, Consider.No, Consider.No);
You can access the game objects of the combatants through their GameObject property.
Just store the list of combatants somewhere and enable them again after battle.
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!
maybe I miss something obvious here in your answer...
...but how can I access a game object in my scene which isn't a player when battle starts.
More concrete: My script is attached to an empty GameObject somewhere in the current scene. If battle starts (battle start event) I want to get that GameObject and call a function (e.g. disableEnemiesWhichAreNotInBattle()).
An opportunity would be to attach this script to each combatant gameobject, but I would really like to avoid that...
You can use the Search Objects step to search for the game object in the scene. If found, the object will be added to a Found Objects list (only available in the running event) or to a Global Objects list. The found/global objects can be used in the other event steps.
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!
List<Combatant> combatants = ORK.Game.Combatants.Get(false, Consider.No, Consider.No);
You can access the game objects of the combatants through their GameObject property.
Just store the list of combatants somewhere and enable them again after battle.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
thanks for the response.
maybe I miss something obvious here in your answer...
...but how can I access a game object in my scene which isn't a player when battle starts.
More concrete:
My script is attached to an empty GameObject somewhere in the current scene. If battle starts (battle start event) I want to get that GameObject and call a function (e.g. disableEnemiesWhichAreNotInBattle()).
An opportunity would be to attach this script to each combatant gameobject, but I would really like to avoid that...
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Thank you very much.