Hi.
I’m building a game similar to Asheron’s Call, and I’m running into a problem with the character movement that has stumped me. I have followed a few other suggestions on the forum here about character orientation and movement with regards to the camera, however, the result is not what I’m wanting.
I got the camera finally to stay in back of the character when she moves and turns, however, when turning originally, she “snapped” 90 degrees in the direction I moved (right or left). I changed the settings so now, the world rotates around her… somehow, but from the point of origin being the camera, not the character. Also, I’ve noticed that when moving “backwards” the camera seems to shake or wobble.
I would like the character to be the point of origin for the rotations and the camera to swing behind the character as she turns. I’m pretty sure I’ve got some things messed up, so here’s some screen shots of what I’ve got. (As soon as I figure out how to attach pictures…)
Player BP: Camera Boom → Camera Settings: Use Pawn Control Rotation = False
Player BP (Event Graph): Movement Input - Gamepad and Mouse:
I’ve replaced the control “Get Control Rotation” with “Get Actor Rotation” for both “Get Forward Vector” and “Get Right Vector” command chains.
Hi Cmdr.Kokoro I’ve invested a lot of time working with Spring Arms, so maybe I can be useful.
I’m think I understand what you are aiming for. Let’s just simplify the controls and spring arm first, later we can add in some artistic complexity:
Class root:
Turn on 'Use Pawn Control Pitch/Yaw/Roll"
Character component:
Turn off ‘Orient to Movement’
Turn off ‘Use Controller Desired Rotation’
Spring arm:
Turn off “Use Pawn Control”
Turn on “Inherit Pitch/Yaw/Roll”
Turn off “Enable Camera Lag”
Turn on “Enable Rotation Lag” (this just a preference, a good starting values are 3-5)
Now you have a simple camera that rotates towards the direction your pawn faces. If you have added rotation lag, it will more slowly/smoothly interpolate to this target rotation.
See if this matches your vision. If not come back here and I think we can figure it out.
If your camera is always directly above the player and facing down, or if you don’t want the pitch roll on the camera, we can make adjustments.
Awesome start! I need to figure out how to rotate the character based on using the left/right arrow keys now instead of using the mouse, and it’ll be perfect! Thank you!
Great! If you consider your initial question answered, you can just mark the solution.
There is a ton of material on character input, your first stop would be Project Settings > Input
I think it’s only half answered. It appears as though the camera is the pivot point when I turn (using the mouse), I want the character to be the pivot point when the character turns. Additionally, I’d like to not use the mouse at all for character movement (using it only for UI interaction). I can disable the mouse movement functions in the Event Graph, but I still can’t figure out how to accomplish the pivoting issue.
Thank you.
Camera component:
Turn off ‘Use Pawn Control Rotation’
Thank you! That did the trick!
1 Like