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.
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.
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
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.
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.
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?
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.