Set view target with Blend is ignoring Camera Component in BP

Hi,

I’m a beginner and I have searched the internet and this forum for 2 days on end now, with none of the solutions working for me, so I am making a post in hopes of getting a resolution.

I’m working in UE5.3, and I’ve set up a blank project, with a new level.

I have a camera actor attached to a spring arm in my Player Controller Class, “CB_PlayerController”, and on event BeginPlay, I attach the springArm to my playercharacter, and then I activate the camera and set view target with blend to playercontroller.

However, no matter what I try, the camera view will always be in the middle of the player pawn, rather than the camera I have set up in my playerController BP.

Please find some screenshots of my setup below:

The blueprint:

If I Play the game, and click on CB_PlayerController0 in Outliner, I can see the view rendered from the camera, so it does exist…:

I’ve tried dozens of different solutions that I have found online, including:

  • “Set auto activate” in the camera object.
  • “set active” for the camera in the event onbeginplay, like in the blueprint screenshot above.
  • Placing a camera in my world and then using an input to switch to the world camera and back. (it will switch to the world camera and then back to the camera view from the middle of my player character.)
  • Making sure the game mode is correctly set in world settings and project settings. (not BaseGameMode)
  • Using a camera in my playercharacter instead of my playercontroller and using that as the New View Target.
  • Setting “auto activate” for my camera in the construction script.
  • Possessing my pawn first (it didn’t make a difference.

I’m at my wits end here and any and all input would be greatly appreciated.

I think that child components can’t be referenced as actors, and instead you may need to use “get actor of class” to get a reference the the actor.

Edit: if the camera is just a component, and not a camera blueprint, then it would need to be replaced with a camera blueprint.

But you can’t plug a camera in a BP directly into the set view target with blend node, it has to be the actor with a camera inside :frowning:

I’ve tried getting “all actors in a class” and then trying all the possible cameras by index but none of them actually got the camera I wanted as my view.

The way I do it is a single Camera in a BP, then reference the BP, and plug that reference into the Set View node.

If you’re trying to do multiple cameras in a single BP, I think that doesn’t work.

Nope I only have one camera in my BP, and then use the BP as set view target (see my blueprint screenshot.)

This works for me in the Player Controller BP. I placed the Camera BP in the Character BP.

You said your custom Player Controller BP is set inside your Gamemode BP, and the Gamemode BP is set in the Maps & Modes?

Maybe you can’t use Set View inside of the Camera Actor that you want to use?

Edit: I wrote this because I thought for a second that you’re in the Camera, but the Target pin is not causing a compile error, so you have to be in Player Controller. I apologize.

Possessing pawns switches view targets automatically.


A better questions here is: why are you doing all this? What is the end goal? What control scheme do you want to achieve?


This is super weird :innocent:

  • the springarm in the PC has a camera2 attached to it, right?
  • we detach the springarm (and camera2) from the PC and attach it to the player
  • we then want to see the PC’s point of view but you gave its camera away to the player…

How funky is this thing you’re making? Note that super weird != bad in any way.

Everynone
A better questions here is: why are you doing all this? What is the end goal? What control scheme do you want to achieve?

Ok, this is a good question. Again, I am a beginner, so maybe there is a better solution to what I want to do.

I want to make basically a city builder, where you can also control certain characters. So I want to have a free-range camera, but also be able to directly control certain pawns, and follow AI characters.

To achieve this, I figured I would have an free range camera in the controller that can attach itself to either an invisible pawn with limited collision, or any other pawn with the spring arm + camera. This way, the zoom and rotation doesn’t need to constantly be reconfigured, and I also don’t need to have a camera actor inside every single pawn’s blueprint.

An alternative way to achieve similar results (that I can think of), is to only ever control an invisible spectator-ish pawn that floats, and that pawn will issue commands to the few characters that the player can directly control.

Edit: it’s weird because it’s the result of me trying a dozen different solutions. This obviously doesn’t work, but I don’t understand why it doesn’t work.

  • the springarm in the PC has a camera2 attached to it, right?

Yes.

  • we detach the springarm (and camera2) from the PC and attach it to the player

That’s the intent, yes.

  • we then want to see the PC’s point of view but you gave its camera away to the player…

What do you mean by giving the camera away to the player? Because I control the pawn?
How come if I add a camera to the player, it still does not render the viewpoint from the camera in the player?

This works for me in the Player Controller BP. I placed the Camera BP in the Character BP.

I am trying this method now, but with the camera still i the playerController BP, and it doesn’t work for me :frowning:

I also tried this, to no avail:

Edit: here is a hint, I guess. Note that this error didn’t occur before adding the above nodes:

Blueprint Runtime Error: “Accessed None”. Node: Set Active Graph: EventGraph Function: Execute Ubergraph CB Player Controller Blueprint: CB_PlayerController

You said your custom Player Controller BP is set inside your Gamemode BP, and the
Gamemode BP is set in the Maps & Modes?

Yes, and in my original post, the gameMode, playerController and and playerCharacter are all correctly shown in outliner when I play.

Make an overview pawn with a camera the PC possesses - that’s your free-range chicken camera. Possess a char when you want that point of view instead.

Don’t overcomplicate this bit. The complex stuff comes later. Avoid attaching / detaching components at this point. If you consider this an optimisation of sorts, it is not.

Thank you for this. I decided to go with this route, but even then, the camera would be stuck inside my player character (just a cube for now, for debugging purposes.)

I then followed this youtube tutorial on the playerCameraManager to override the camera and set to the position of the camera actor inside the playerCharacter. It works and I now have the camera view I want.

Probably not optimal, but it works for now.

I’ll flag my own response here as the solution. Thank you so much to people who responded here.

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