Switching First Person Camera To Third Person When Spectating

Hello, I recently setup a spectate system where when a player dies they spectate the other players that are alive and the spectating itself works as intended. My problem is the active camera before they die is first person pov and I can’t figure out how to switch the camera to the inactive third person follow camera only when spectating.

Here is the blueprint I made to spectate different players which works (besides the switching cameras aspect)


Here Is The cameras I want to switch between (active first person cam and inactive third person cam)

I managed to use 2 set active nodes in the character bp that successfully switch between the cams after death but this is only for the player that dies, when they spectate others, it switches to their first person pov because they didn’t die yet.

Any help with this would be greatly appreciated, and please let me know if any more info is needed.

I see you watched this tutorial? :slight_smile:
The way I would try it, but I’m not 100% sure it will work, is to get reference to that other camera from the Pawn itself, and then use SetViewTargetWithBlend on that other camera. Because, if you just select the pawn, then it will take it’s default camera.

So, from the player list, when you get PlayerController, get it’s pawn, cast it to the pawn you are using, get it’s spectate camera reference, and use that with SetViewTargetWithBlend.

When I was making spectators for my game, I only used one camera, so not sure if this will work.

Using SetViewTargetWithBlend only uses the camera that’s set to Active. So you either force toggle the active camera on the sim Or your Spectator class uses its own camera’s aligned with the sims.

1 Like

Is there a way I can force toggle the active camera just for the dead player? Whenever I try to set switching between the active cameras anywhere before the death event it starts both players in third person. My spectator class where both cameras are located, is the main character bp itself.

Create a Spectator class.
Get a reference to the target Sim.
Attach the spectator class to the target sim.
Use Set View target w/blend to use the sims active camera.

Using the reference you can toggle the active cameras on the sim.

What if Non active camera is used as New View Target instead of the pawn itself. Shouldn’t that focus on that camera? I assume what you say makes sense when pawn is New View Target, but does not make sense if it’s camera reference is the New View Target.

That was the tutorial I watched and it works great besides the specific issue I’m having. Your answer seems like it will work, but I’m lost on how to follow your instructions. I’m not sure where to get the controllers pawn because I don’t believe I’m referencing the controller but the character itself in the array (I’m not really sure tho this is all new to me)

From My Game State


In My Character BP

As for your most recent reply, when I try to set the camera reference itself as the new view target, it says the camera component object ref is not compatible with the actor object ref in when I connect the pins if that’s what you meant.

If this Player element in the list, is character. Just cast this to your own character. Use Cast node. Then use get{whatever you named your second camera}, and use that as New View Target in the method SetViewTargetWithBlend. As I say, I have not tried this. @Rev0verDrive could be right this would not work. But you can try it.

SetViewTargetWithBlend works with the Camera Manager. It will only blend to Active cameras. You can’t simply say use X camera. Thus why you have to manually toggle the pawns active camera.

When spectating in general you should have an array of all “Alive” pawns. These should be references to the sims on your client.

When you select a Sim to spectate you use the reference of said sim to target its active camera. You can use the same reference to switch what camera is active on that sim. Camera Manager should (if I remember correctly) auto switch to the active camera.

Set active the one you want to switch to, then disable the currently active.

1 Like

Here’s standard character class camera toggle code. This simply activates/deactivates cameras. Camera Manager auto swaps to the “Active camera”.

Using the above code I’d simply call “Switch Camera” on the Sim proxy via reference.

I just recreated this and it works well, but where would I implement this when I go to spectate the next player? So it switches for the dead player but not the player being spectated

In your Spectator Class.

Here’s a rough out of the process I do.

So are all these functions being made in the spectator pawn class where the new camera is located or inside the main character bp? I made them Inside the spectator pawn bp but am not too sure what results I’m looking for. I really appreciate all your help and sorry this isn’t clicking with me.

The previous post pic (toggle camera code) is in the main character class.
Last post pics are in the spectator pawn class.

When you DIE the server (GM) spawns a spectator class for you and possess it with your controller. From then on your pawn is a spectator pawn.

Could you explain the variables? I’m guessing pawn would be my main character bp, but what about the spectate controller, and spectated pawn ref.

I have a function that gets the player ref from array via Select in UI or trace.
It passes the reference to the Spectate Player event.