Control new pawn without switching camera

Basically, I’ve set up some first person possession code, that makes it so that I can posses a pawn with a camera and move it around a map. I’ve set it up so that what the camera sees is projected onto a screen, and I want set it up so that when I posses, I can control the camera, but i continue to see out of the first person character. any ideas?


Hi @EvanGames22

My suggestion is you do not possess the other camera. Instead have a way of interacting with the screen. Set a boolean value say “bRemapControls”

In your player character check for if this is true, if true then send movement instructions to your remote camera, if false do the normal playe movement. Ensure when you exit the screen interaction you reset your boolean to false.

This way it keeps your player the main character and view at all times, especially if the player can take damage etc whilst using the screens

How would I go about this? wouldn’t it be easier just to change the viewport to the first person character. I’m trying to simulate a spaceship flying by using the camera screen as a window.

Hello.

So you trying to posses another pawn to control it and when you move that pawn it should be projected but thats not the case and its just projecting the default character?

When you are not possesing it, the projection is in order?

The projection is working fine, I set up a render target inside the pawn and it is projected on the screen, but when I posses the pawn the view switches to the pawn. What I want to do is keep the camera view on the first person instead of switching when I posses

I think passing controls via an interface or similar to the other actor would be better than possessing it as i stated before.

If you must use the change camera method then i suggest set view target with blend.

Possess your new character then swicth the camera back to your original pawn.

Try using something along those lines, obviousley substituting the new pawn and player pawns in the correct places as needed

Hello, just saw this post and wanted to share a potential answer. In the Player Controller Blueprint, search for “Camera” in the details panel. You will see a bool variable called “Auto Manage Active Camera Target”.

By default it is set to TRUE, if set to TRUE then the camera will automatically attempt to find a camera on the new pawn when the “posses” function is called. If there is no camera on the new pawn the view port will instead set itself to the transform of the pawn.

So if you want to change pawn possesion but want your camera to remain the same actor. Then all you need to do is set “Auto Manage Active Camera Target” to FALSE. Setting it to FALSE will cause the camera for that player controller to remain whatever it was before the “posses” function was called.

I recommend using “Set View Target With Blend” to always manage camera functionality such as this.

Cheers

4 Likes

I did this in BeginPlay but it still does not work.