Hello guys, i created a global game event that will spawn a game object (shield) when a weapon(is equipped), then destroy the shield when the weapon is not equipped.
In the game event, i used equipment fork condition to check if the weapon is equipped. If it is not equipped, the prefab gameobject is destroyed and the change game variable condition is called. Which sets the game variable float Equipped to 0 . If it is equipped, a check game variable condition is called, which checks if the float Equipped is less than 1.If yes then a gameobject(shield) is spawned,if no nothing is done(this is done to avoid spawning more than one shield, when the weapon is equipped). Then in the next step the game variable float Equipped is set 1.
but surprising the prefabs are not destroyed when a new weapon is equipped. Any assistance will be appreciated
First, leave only the destroy prefab node in your event, and see if it still doesn't work. If it doesn't, then you know it's something to do with your prefab setup, and not your equipped 1 or 0 logic.
Second, add console line nodes with #varfloatTheNameOfYourVariable# to make sure your variables are set to the correct number, that way you can debug your event.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!