Stop movement speed of characters when hit the wall and animations when hit the wall?
I'm new to Unreal Engine 4, and I started to learn about 4 days ago, and now i'm trying to make running system with parkour elements but I'm stucked when character hit the wall but max walk speed( I think) still keep it value but not decrease to 0 because hit the wall XD.
I created a blueprint when player run depended on tps template, then stamina will decrease and camera will start shaking, but the problem when character hit the wall, the stamina still decrease and camera still shaking.
So I think the problem because the character movement speed still in max value. Can u guys help me stop the character movement speed when touch the wall? and add some animation when character hit a wall?
asked Feb 11 '17 at 12:15 PM in Using UE4
it's because your logic says if the player pressed the button to run, so he is running(is run on = true) so i will reduce the stamina, but actually if the player press the key to run he is TRYING TO run, i suggest you to remove stamina based in the player velocity instead of removing 1 at every 0.2 seconds from stamina try to remove the speed / max walk speed (so if he is trying to run against a wall the speed will be 0 and the stamina won't be removed), you can type "get velocity" it will return the actors velocity and it's a vector, to get the actual speed grab the returned vector from velocity and type "get length".
have in mind: speed = length of the velocity vector. this is just a workaround, but you can achieve a better solution keeping in mind that you should also take the actual speed in count not just the max speed.
and maybe you know it, but you don't need to change the max speed every frame to have the "accelerating" feeling, you can also set "max acceleration" to a lower value, "max acceleration" is under character's movement general settings.
Follow this question
Once you sign in you will be able to subscribe for any updates here