How to delay mouse input?
So I have my pawn pitch and yaw responding perfectly to my mouse input - however what I want, what I really really want, is to add an intentional delay between the mouse X/Y axis and the pawn moving. I know that seems like something you would not want to do, however I do need it.
I've messed around with delays and timers in every way conceivable but they wont work as the input from the mouse is constant like a tick so delays just cause stuttering, obviously. I need some way of recording the last few frames of input and then applying it after a time has passed.
asked May 10 '16 at 10:15 AM in Blueprint Scripting
Hi man , its not the best way to do it but here an example.
Make a float array. set it to 100 , or use the begin_play event to set it properly. The lenght of the array is directly connected to the time you want to delay.
Now Get the mouse event and use a loop to : Move of 1 place every value stored inside.
Set the 100°(the last) as the 99, then the 99 as the 98.... and in the 0 put the current mouse value.
This will store all the amaunt of the mouse for some time. To use it you simply use the array100(the last) , instead of the current mouseX.
Depending on the framerate you will have variation in the time delay.
answered May 10 '16 at 04:21 PM
Could you not just use a "disable input" or you need the player to be able to continue to move and just not have control of mouse inputs?
answered May 10 '16 at 05:58 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here