Trying to setup a bool variable in the character blueprint that is true when the player is not moving. First screenshot is the character BP event graph, the second is the function bPlayerNotMoving.
In the current setup is is always on, even if he is moving.
I don’t think that is the problem. I have the same setup in a widget, calling the exact same function and it correctly displays the boolean depending on player speed. I would like to know if there is something wrong in the setup I have created.
You are setting the variable after each tick, but in reality it should be set only if the player does or does not move. This condition alone is the BOOLEAN that needs to be TRUE for the camera to shake. You don’t need ta call a check every tick, since it is already asking the Boolean if it is true or not.
Add “Do once with reset” after branch in camera shake graph.
If it starts shaking and never stop Xintoc was right.
then you need to add some delay and reset do once gate.
What I mean is Imagine Event Tick as a burst of TICK TICK TICK TICK times infinity per second. Now before the camera shake could end, there comes another tick saying “Hey, start the shake animation again!”
Here it is set up so that When the player speed is not equal to “0” then event tick will play “MyShake” Camera shake Once and after the duration of the animation the event tick is allowed to play it once more.
There is probably a better method to loop the shake while holding down a certain input/key which would get rid of the Event Tick entirely.