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"

Orient Rotation only on forward


what would be the best way to make the character rotatate to movement only on the forward movement (so I can implement strafe animtions and backward run, without rotating the character there)?

I only found "CharacterMovement->bOrientRotationToMovement = xx". which either disables it completely or makes it rotate in all directions.

I am gratefull for c++ or blueprint solutions, but I rather prefer doing it in editor/blueprint.

Thanks in advance!

Product Version: Not Selected
more ▼

asked Jan 13 '15 at 01:50 PM in Blueprint Scripting

avatar image

31 6 11 13

avatar image eXi Jan 13 '15 at 02:05 PM

I guess i don't understand what you want to achieve.

You want to stop the rotation of your character? Or what is "rotate to movement only on the forward movement"? :D Does this mean you want that the character can only rotate if he is moving forward?

avatar image Hermi1988 Jan 13 '15 at 02:12 PM

Yeah basically.

I want to rotate the camera around the character freely, as it is in the third person template. So when I watch at my character from the front view, I want him to turn around as soon as I press W. But If I press A or D I want him not to rotate, so I can strafe

avatar image eXi Jan 13 '15 at 02:20 PM

Ok, you would need to disable the A and D buttons, or at least use some branches and bools to toggle rotation. In your project settings, you will find inputs that are probably set to A and D for rotation or something like that.

In your CharacterClass or inside the Controller Class (depens on your setup), there should be a part where the rotation is controlled by the Input that belongs to A and D. This is the part where you need to disable it. Either delete it, or use branches etc.

For the W part. You will need to get the direction of the camera. You can get the forward vector of the camera for example, or use the rotation and calculate the forward vector from the yaw value. There are a few more ways to do this.

If you have the direction, you need to add input for the W key. I guess there is already an input for it if you are using a template (first/third person). So there is also a part in the character/controller class for the W key. Check this part and change it to let the character move in your new direction.

avatar image Hermi1988 Jan 13 '15 at 08:17 PM

I seem to have managed to solve it, but I thank you for you efforts nonetheless. I read that too late I guess :D

avatar image eXi Jan 13 '15 at 11:16 PM

Please provide a small answer with your solution and mark it as solved (:

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

1 answer: sort voted first

One way I found of doing this was to create a key event for whichever movement keys you want the character to stop rotating for (eg. A,S & D), then drag out from 'Pressed' and create a 'Set Use Controller Rotation Yaw' node, then tick the checkbox, then do the same for 'Released' except this time leave the tick box unchecked. It should look something like this (I only set mine for the 'S' button, but just link any additional key nodes to the 'set' nodes if you want to lock rotation when that button is pressed):

alt text

yawrotation.jpg (56.1 kB)
more ▼

answered May 06 '15 at 01:03 PM

avatar image

16 2

(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