Rotate Players camera?

trying to get the players camera to rotate to the side (with blend) when inside the volume/trigger. Haven’t a clue to why this isn’t working already with my current blueprint setup.
Any Clues? :S

Which template have you used to create the project?

Is the camera (And, possibly the spring arm component) set to use the controller’s rotation?

The first person blueprint template

I haven’t a clue… unsure. What is the spring arm? This is within my char blueprint but the rotation hasn’t come off the get controller node if that’s what you mean?

First of all, you’re adding ‘relative’ rotation which means you do not need break&add your current rotation - it does so automatically.
Here is a minimal sample of how you’d do it:
controllerrotate.png

Your camera is using PC’s rotation, so if you wanna be able to rotate it manually, you have to open you pawn BP, select the camer in the components mode, and in the details panel, set “UseControllerViewRotation” to false. Alternatively you can also modify controllers rotation, yaw component in this case.

I don’t want to move the camera manually all of the time ( if by manual you mean set it in BP), the camera tilt is for a wall running mechanic once player is overlapped with my volume, so I would reverse the rotation after the overlap ended. Not sure if this makes much difference.

EDIT: Whoops, I accidentally named the events “BeginWallWaking” and “EndWallWalking” because I was reading another post on the forum while making it, hehe, fixed it now.

So if I understand you correctly, you want to rotate the camera (say 25degrees to the left) when overlapping a Trigger -
then you want to rotate the camera back to it’s original rotation when outside of the Trigger?

Here, I made an example and tested it, it should work just fine.

Add this to the MyCharacter Blueprint:

http://imageupper.com/s02/1/8/G139768966764137_1.png

Then make a simple Blueprint with a TriggerBox:

http://imageupper.com/s03/1/8/N1397689860645796_1.png

Let me know if you don’t understand some part of the blueprints!

Shall try This now! Many Thanks for the great visual help! :smiley:

No problem :slight_smile: I’m happy to help as I learn a lot myself.

And, I almost forgot! There is one more thing you have to do to make it complete!

Open the MyCharacter blueprint, navigate to the Components tab,
then detach the Mesh1P from it’s parent (Camera), like this:

http://imageupper.com/s02/1/2/A1397692805644975_1.png

Then just re-adjust the Mesh1P to align with the camera, like so:

http://imageupper.com/s02/1/2/A1397692805644975_2.png

This way the camera can rotate independently of the arms and character controller.
That’s it! Hope it helps.

Many Thanks man, adapted this to my other custom events and managed to get it working! :smiley:
however is there a way to blend the camera rotation when it changes?
Cheers, great help!

:slight_smile: Glad it worked for you,
Yes, you can smoothly interpolate the camera to reach it’s destination,
this might look a little complicated, but it’s fairly easy once you read each node!

  1. Add a new Variable in the **MyCharacter **blueprint, call it **DesiredRotation **and set it’s type to Rotator

  2. I simply added an **Interpolation **node (RInterp To), then I just added the extra nodes which are required for it to work properly!

This is the modified MyCharacter blueprint:

http://imageupper.com/s02/1/3/M139769946564263_1.png

Keep in mind that it now uses Set Relative Rotation, instead of Add Relative Rotation - It’s a big difference.

Also, don’t let the size of the blueprint overwhelm you, it’s really easy once you try it for yourself a few times.
The way I went about making it was to add that **Interpolation **node, then asked myself how to get it to function properly; the rest was a walk in the park,
you might want to try that instead of copying directly!

I hope this helps you reach your end goal,

Good luck!

Definitely the best help ive ever received on a forum, hope I can one day help someone as much as you’ve helped me on here. haha thanks very much! :smiley:

Oh I just noticed a potential bug on the reset event!
Since the blueprint is using Relative rotation (relative to it’s parent rotation) there
is no need to get the Control Rotation, you can just reset it to Zero.

Luckily, it’s pretty easy to fix, like so:

http://imageupper.com/s02/1/7/A1397755780644142_1.png

Hi Real, i have changed a few things from what you posted but it seems to be working. I was having an issue where i my char couldnt look up or down. to rectify this i have just done the following with use controller view rotation (Bool). ive been toggling it on and off to at certain points.
Is the way i’ve done this fine?

If so great haha, need to swap this camera rotate to the other side (if wallrunning on right side), guess i would have to grab the players orientation to the volume and calc weather or not play right cam rotate or left cam rotate

Hello again,
Hehe, you managed to add some hacks in by toggling the controller rotation, good job!
But there is a much easier way to go about fixing the issue :stuck_out_tongue:

By enabling the Use Controller View Rotation you no longer have control over the rotation, which is not very handy,
what you can do instead is to take the Pitch from the Player Controller and just apply that to the** Interpolated Rotation**.

I changed the blueprint a little bit, there is no more breakRot/makeRot from the First Person Camera.
Notice that the X axis is equal to Roll,
Y is equal to **Pitch **
and Z is equal to Yaw.

In order to fix the problem where the character cannot look up or down we need to get the Up/Down axis (Pitch) and add that to the Interpolated Rotation.
Basically, we can add a node called Get Control Rotation this node holds the rotation values from the Player Controller.
In order to add that node by Right-Clicking you might have to uncheck the “Context Sensitive” checkbox when searching for the node,
the reason for that is because the node extends Player Controller and there is no Player Controller node there.

Alternatively, you can also add a Get Player Controller node and drag the Get Control Rotation from it’s output - then you won’t need to turn off context sensitivity!
Also if you already have the node in the blueprint you might not need to turn off context sensitivity, which is really awkward lol.

I am not very great at explaining stuff, but hopefully that makes sense :smiley:

Here is the final blueprint:

http://imageupper.com/s02/1/6/L1397783284649119_1.png

Sorry for the late reply to this. Easter breaks n all. Just like to thank you again for your help. Hope you had a good easter :slight_smile: