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"

How can I rotate a pawn?

I have a pawn as main character and I want it to rotate according to the asdw keys. How is the best way to so this?? i Try using set actor rotation, but when I collision with something, my pawn stop moving.

Product Version: UE 4.16
more ▼

asked Mar 20 '18 at 07:36 PM in Blueprint Scripting

avatar image

10 4 5 11

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

1 answer: sort voted first

"Set Actor Rotation" is what you would use if you want something to "spin" indefinitely OR if you would like to "instantly" rotate one actor/character/pawn etc to face another actor/pawn/character. What you want is "movement control" correct? You don't want to "rotate" per se as much as you want to "turn" your main character to face a direction of your choosing? Assuming this is the case what you want is to go into project settings, input, axis mapping, and "map" a key to rotate the player around the Z axis. Add axis mapping by clicking the little "+" next to the Axis mapping settings. Then just pick whatever key you want, say "D" and set it to 1.0, then add another axis map and set "A" being the opposite of the D key by convention and set it to -1.0. Then go to player controller, or player character wherever you like and right click in the event graph, search for axis mapping (Whatever Name You Chose) and use that to add input "yaw". And you're done. Should look like this...alt text

more ▼

answered Mar 20 '18 at 07:46 PM

avatar image

Nebula Games Inc
5.4k 28 9 15

avatar image David.Borrego Mar 20 '18 at 08:03 PM

Yeah, I want movement control. I do what you say, but what moves is the camera and not the mesh. Has something to do that is a pawn instead of a character?

avatar image Nebula Games Inc Mar 20 '18 at 08:17 PM

So you do want to just spin an object/character around? Haha Here, this will do that then. alt text

rotate-player.jpg (98.2 kB)
avatar image David.Borrego Mar 20 '18 at 08:20 PM

Nono, I explain myself better: I want to have a pawn as if it were a character, with the rotation control that the character has, but in a pawn.

avatar image Nebula Games Inc Mar 20 '18 at 08:38 PM

So, your question is kind of confusing now. The difference between a "character" and a "pawn" is basically how much more "functionality" they provide you with out of the box. So a pawn can do everything a character can but you will have to "code" more yourself which gives you more flexibility in what you can do. I don't know what "character" in particular you want. Because the first person character moves differently than the 3rd person. The first thing i told you about gives 1st person perspective, the second one I showed you is more 3rd person controls where your player can rotate independently of the camera view. So again not quite sure what you are going for here.

avatar image David.Borrego Mar 20 '18 at 08:44 PM

Sorry, I didn't mentioned that it is a 3rd person. But the second option you told to me it's not work like a 3rd person of a character blueprint. It rotate but not like a "rotation control" perfect

avatar image Nebula Games Inc Mar 20 '18 at 08:53 PM

Got you, I am messing around with it right now I see the issue. Haven't worked much in 3rd person though. Might need a camera boom and use that to rotate around the pawn as a focal point. Have you tried looking at the 3rd person template and seeing how Unreal handles the controls?

avatar image David.Borrego Mar 20 '18 at 08:58 PM

Yeah, I see the third person template of Unreal, but i can not see where implemented the control rotation. Thanks for interesting in it. If you find the solution I will be very grateful

avatar image Nebula Games Inc Mar 20 '18 at 08:17 PM

Replace "Cube" with [Your Desired Mesh]

avatar image Nebula Games Inc Mar 21 '18 at 02:07 AM

Figured it out, you need a "spring arm" and to set a couple things in the details panel I have provided screen shots. Now it rotates "around" the 3rd person character as you like. Also this is in a "pawn" class BP, no issues or reason it needs to be in a "character" class. Hope this helps.

alt text

alt text

avatar image Nebula Games Inc Mar 21 '18 at 02:21 AM

I forgot to show you the "player character (self)" settings, so I went back and took a screen shot but I had already switched the class back to being the regular character BP, so that is why the components panel in the final image is different from the first two, but it works either way with these settings.

avatar image David.Borrego Mar 21 '18 at 09:08 AM

I find some information and I want "Orient rotation to movement" in my pawn. In character Blueprint this a check in the character movement, but in a pawn this check doesn't exist and my pawn mesh don't rotate.

avatar image David.Borrego Mar 24 '18 at 10:16 AM

Any other solution??

avatar image David.Borrego Mar 21 '18 at 07:54 AM

You didn't understand me. You explain me how to rotate the camera, but i want to rotate the mesh in a pawn. The camera works perfectly, but the mesh don't rotate when I move.

avatar image Nebula Games Inc Mar 24 '18 at 01:37 PM

If you want more help post a video or a link to the "rotation" you're trying to achieve because I don't even understand what you're trying to do anymore. I've rotated everything you could possibly rotate in a player character and it's not what you want so I stopped trying.

avatar image David.Borrego Mar 24 '18 at 02:00 PM

I want that to 3rd person pawn works like 3rd Person Character, and what I want is to orient the mesh according to his direction but without using "Set rotation". I do not use Character because of the collision. The Character collision is a vertical capsule but my character is a dog and the vertical capsule it's not appropiate.

Thanks for your patience

avatar image Nebula Games Inc Mar 24 '18 at 02:36 PM

Is this what you want it to look like?


avatar image David.Borrego Mar 24 '18 at 02:39 PM

If this is a pawn, yes. How did you do it?

avatar image Nebula Games Inc Mar 24 '18 at 02:44 PM

Haha yea it is a "pawn" BP, can't you tell by how crude looking it is? I just threw it together in the last 15 min. I'll show you how I did it in a minute.

avatar image David.Borrego Mar 24 '18 at 03:00 PM

plis, show me

avatar image Nebula Games Inc Mar 24 '18 at 01:40 PM

Someone else tried the same thing a couple years back, they ended up just using the character BP. Any particular reason you don't want to use the character BP?


avatar image Nebula Games Inc Mar 24 '18 at 03:26 PM

Here is a tutorial on how to do it.


avatar image David.Borrego Mar 24 '18 at 03:48 PM

but in this tutorial you use "Set world rotation" that it's a telerport and when you walk near a wall it can get stuck. And, for what I understand, this isn't "Orient rotation to movement". If you press A key all the time, the mesh still snipping all the time without stopping.

avatar image Nebula Games Inc Mar 24 '18 at 03:57 PM

Honestly man I don't know how else I can help you. I have tried everything I know how to do, I even experimented with things until I figured out how to create the above functionality (I never did that myself before today) and I made a tutorial video just for you. It sounds like you are really trying to do multiple things not just "rotate a pawn", or "orient rotation to movement". Getting stuck in a wall sounds more like a collision property issue, mesh "snipping" I am not sure what exactly that is. Maybe someone else in the community can offer you some help. Unfortunately I have no idea what you're trying to do anymore, sorry.

avatar image David.Borrego Mar 24 '18 at 04:00 PM

I want a 3rd person pawn with all the characteristics of the 3rd person character.

avatar image Nebula Games Inc Mar 24 '18 at 04:07 PM

I understand that you like everything in the 3rd person character BP except how the capsule collision is set up. The problem with that is you can't just "change" the one thing you don't like when it is an "inherited" part of the BP. Which means what you're asking for is someone to know literally everything Unreal put into the 3rd person character, exactly how they coded it and then re-create that in a pawn. I don't know C++ but if you do, I would probably start there, grab the source code for the 3rd person character and modify the stuff about capsule components. Short of that you would have to script your own logic for everything you want from the character BP into the pawn and that is way more complex than simply rotating a pawn like the 3rd person character. I don't think there is an easy answer to your problem. I wish I could help you but this is more complex than the question appears and not something I know how to do. Sorry man, like I said, maybe someone else knows how to help you.

avatar image Nebula Games Inc Mar 24 '18 at 04:10 PM

Also, seriously man, check your collision properties, getting "stuck in a wall" doesn't sound at all like an issue with character movement/rotation. And I would post screen shots of your set-up, videos of the "stuck in wall" problem and anything else that might help someone in the community reading this to understand what you need.

(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