Proper chain for applying and power-up and turning it off
-
Hi everyone,
I am having difficulty getting power ups to work in my games. I can turn them on and the effects work but I can’t figure out how to shut them off.
Any help would be appreciated thank you I’m very new to building games.
-
@versioneight With a screenshot of your behaviors we can have a more specified discussion, but off the bat a "set behavior state" behavior (in behavior tab "custom") will probably get you to where you want to be.
Say you want the item buff to last 30 seconds: after the buff trigger, add a "timer" behavior. Attach a "set behavior state" and make it turn off the behavior tree inflicting the buff (setting the behavior state to "off" on any behavior in a behavior tree will stop all subsequent behaviors from triggering as well.)
There's some complications here like: 1. if the buff was a flat value addition, turning of behaviors won't then change values back (in that case you could reverse the effect by storing the buff value and adding when buffed, subtracting when not. 2. You will need to turn the behavior tree you turned off back on so that it's ready to receive a subsequent buff (can be done with the existing timer or maybe when the object is picked up or whatever).
I feel like I'm not making a ton of sense but if you screenshot the behavior tree I promise to be a little more coherent xD -
Thank you so much for your help here’s a screenshot I’m very new to understanding how the chains flow haha 😂🙏