Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Make backwards movement slower

I am currently trying to make a top-down shooter but I've run into an issue

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)
normal movement

but when the player is shooting (i.e. clicking) the character always faces the cursor
shooting movement

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?

Product Version: Not Selected
ezgif-save(2).gif (358.1 kB)
ezgif-save(3).gif (249.1 kB)
more ▼

asked Jun 18 '14 at 12:58 AM in Blueprint Scripting

avatar image

36 2 5 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Jun 18 '14 at 01:05 AM

avatar image

1.2k 50 24 51

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Maybe this will help anyone who comes across this in the future. ![alt text][1]

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. [1]: /storage/temp/133228-screenshot+2017-04-06+21.51.26.png

more ▼

answered Apr 07 '17 at 01:59 AM

avatar image

69 9 9 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question