Use the camera attached to a pawn

Hi!

I’m using Unreal Engine 5.2.1.

If I have a pawn with a spring arm component and a camera component attached to it. And the camera is That’s what I want the player to see, what do I have to do?
imagen

Thanks.

Hey @ViaCognita

you will have to (either…or):

  • Set your pawn to AutoPossessed by Player0 after placing it in the map. You can do this in the details tab of the pawn after placing it in the map.
  • Set a GameMode for the map where you set your Pawn as default class. You will ahve to create a GameMode and set it in the WorldSettings of the map.
  • Use your PlayerController with a SetViewTargetBlend in the level blueprint.
1 Like

Hey @L1z4rD89!

Thanks for your answer.

So, a pawn with a camera component attached to it, magically makes the level uses the camera’s view as the view for the player. Is that correct?

I’m asking this because I though I have to do something to set this camera as player’s view.

Thanks!

There is no such thing as the level uses a camera. Levels have nothing to do with it. Instead, there is a class called the Camera Manager:

image

Even if you place no cameras anywhere, the engine will create a default camera manager whose view we will be using.


When you possess a Pawn, the camera manager looks up the first active camera component it can find in that pawn and starts using it as its view. Non-pawn actors cannot be possessed, but we can switch to their point of view:

image

Again, the PC’s camera manager will look up the first active available camera component in New View Target and use it as its view. If no suitable cameras are found, the point of view defaults to the world transform of that actor.


The camera manager works closely with the player controller and knows which actor’s point of view we’re using:

image

You can use it for gameplay purposes. Actors also get a notify when we start using their point of view:

image


And you’re not limited to the default camera manager, you can override it, which gives you a couple extra features:

image

Most importantly:

You get to completely override any camera work and provide your own solution here.

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.