Modify the controller with a Stat

(NOT finished YET)

Check this 3 Samples on how to Modify different behaviours of the AC with different Stats

Let's disable the Sprint on the animal when the Stamina gets below 10. and enable it back when the Stamina is over 15.

  • Select the Stamina Stat on the Stats Component and search for the Event Section:

  • On the Below and Above Section, Set Below=10 and Above = 15.

  • On the Event On Stamina Below 10, Add a new Listener and Use MAnimal > UseSprint = False

  • On the Event On Stamina Above 15, Add a new Listener and Use MAnimal > UseSprint = True

That way when the Stamina will disable the Use Sprint Parameter on the Animal in case it gets below 10 and it will enable it back when is above 15.

Now we need to Start degenerating the Stamina when the Sprint is true on the Animal.

We can do this by using the On Sprint Enable Event on the Animal.

  • Create 2 Listeners on the Event.

  • On the 1st Listener use Stat > Stat_Pin(StatID)

  • On the 2nd Listener use Stat > Stat_Pin_Degenerate(bool) *Dynamic Bool

That way every time we use the sprint .. the Stamina Stat will degenerate.. and when we release the sprint the Stamina Stat will stop degenerating.

Last updated