Make backwards movement slower
What i want is to make the character run slower when running sideways or backwards
When the character is only moving the character automatically faces to the direction of movement (ideally to go top speed)
but when the player is shooting (i.e. clicking) the character always faces the cursor
I have my scripts in the player controller but i'm not sure if they should be there or in the character blueprint...
What I am looking for is a way to make sideways movement slower (like 0.8x) and backwards movement slower (like 0.5x)... but I could not find where to start
I was thinking in limiting it in the blueprint by mapping the angle to the cursor (0...180 deg) to a speed value (1...0.5) and setting the character movement max speed to that, but I think it is a hacky way and I think there should be a better way
I was also thinking I should subclass the CharacterMovement component in c++ and add my custom behavior there, I think this should be a better way as it would separate things more correctly... but again I don't know if it is possible or how to do it.
Is it any other way to get what I want? What would be the better way to accomplish this?
asked Jun 18 '14 at 12:58 AM in Blueprint Scripting
you could reference the GetForwardVector and GetRightVector. Then change the groundspeed when those are active. So if GetForward is <0 then Set Groundspeed. And if GetRight is != 0 then Set Groundspeed. Of course you would also have to check these with a bool and make sure that normal forward is set back.
answered Jun 18 '14 at 01:05 AM
Maybe this will help anyone who comes across this in the future. ![alt text]
So the little dot is a "Dot Product" and the highlighted nodes are the ones that turn forward movement into a positive number and back movement into negative number. : /storage/temp/133228-screenshot+2017-04-06+21.51.26.png
answered Apr 07 '17 at 01:59 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here