Camera movement system

Hello,

Please bear with me as this is all very new to me. If I am using an completely wrong approach, I’m perfectly happy to start from scratch and do it the right way.

I’m trying to set up a blueprint that will allow me to easily set the view to preset targets (that I have set up using Target Point actors).

The purpose is to have a system where I can plug in a shortcut key and the target actor to a single node and have the view smoothly move to it upon pressing that key.

To do this, I have:

  • Created a blueprint class that inherits from Default Pawn.
  • Created an Event within this class called “MoveToDestination”
  • The MoveToDestination inputs a Target Actor (to get the location and rotation of it).
  • I’m using Move Component To to set the location of the Pawn to the Target Actor

The above works for position. However, I cannot set the rotation using Move Component To and I don’t know how to fix it.

I can set the rotation using Get Player Controller and Set Control Rotation, but I need it to translate and rotate at the same time.

51744-level+blueprint.png

Hah! I managed to sort it out simply by creating a Camera component in the Blueprint class. Now I can just hook up the target actor rotation to the Move Component To node and it works perfectly!

Ok, it seems I jumped the gun with the above.

Adding the camera takes away my ability to move and look around. I can re-enable this by setting “Use Controller Pitch and Yaw” on the Class Defaults, but after the (successful) transition, the view snaps to the camera’s original rotation value.

Basically, all I need to do now is align the camera to the player view once the move is complete. Any help achieving this would be much appreciated since I can’t get it work.

Thanks.

So I had the answer staring at me the whole time. All I had to do was execute the Set Control Rotation after the Move Component To. That aligns the camera and everything works perfectly now.

Here’s the working blueprint: