Today we return back to the Player Character series, this time talking about how we can add in a crouch component, switch states from idle to armed and combine all those mechanics together using some blending techniques. Additionally we are going to introduce a timer mechanic that resets our armed stance back to idle.
As usual you can find the project from the video on our GitHub page.
So as you can see the implementation is pretty easy to understand.
We are creating a timer from our Time Manager object.
We are then registering this call back to use our Timer Handle.
Then we assign a callback method to be triggered at the end of our countdown.
Then finally we set that the countdown duration is 5 seconds.
Excellent ! Let’s blow some things up.
Timers can also be used to trigger modifications to specific values every so often. In this case we are going to simulate a fuse that will count down every second before it triggers an event.
First we are going to call the timer as we did previously, except this time we are going to call a new method and have this timer run every second.