x

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"

character rotation resets (wasd movement and rotation)

so i have this problem where i want my char to move and rotate with wasd. the char moves and rotates correctly. it looks like this alt text

BUT! the rotation resets everytime i stop to move. can someone pls help ?

Product Version: UE 4.15
Tags:
11111111111.png (293.8 kB)
more ▼

asked Apr 20 '17 at 05:24 PM in Blueprint Scripting

Neo Henroy gravatar image

Neo Henroy
1 1

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

The problem you have is that you are setting the rotation of the actor depending on the input every tick, if you have some input then the rotation is being set to the direction you calculated but when you stop that input resets to 0 (MoveForward and MoveRight) and the calculation to get the move direction will return 0.

So to fix this issue I suggest that you don't do this on the Tick function but rather get a callback from the input events, so that every time you press the key you set the rotation and the movement of the player.

Hope this helps, you can also take a look at one of the templates from Unreal, like the 3rd person and open up the PlayerCharacter blueprint.

more ▼

answered Apr 21 '17 at 09:46 AM

nullbot gravatar image

nullbot
132 8 7 11

Neo Henroy gravatar image Neo Henroy 4 days ago

the failure was "useControllerRotationYaw" what seems to reset the rotation to zero. but you are right i was thinking it would be something like that but i can use inputaxis events too just like you said. thanks anyways. :-)

(comments are locked)
10|2000 characters needed characters left
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