Help with camera setup on turn based party game.

I have two cameras setup in my game, one is like high above the game board BP_GameCamera. And another that is a camera component attached to a game piece. I just want to use the game piece camera and not the other one. Its setup now that when a game piece is moved, the camera view is changed to the high camera, i want it to stay on the camera attached to the gamepiece. (Like in mario party, when the camera is on the character) I cant seem to stop the switch to the above map camera and it to stay on the game peice camera. Anyone good with camera setup? can explain more in detail if anyone is interested in helping me out. THANKS!




Hey @lmesing7! Welcome to the forums!

Do you think you could get us any code interacting with the camera? Screenshots are best!

Look forward to seeing it!

Thanks @Mind-Brain . Edited with some images.

Ok. So here:


The “Set View Target with Blend” is how you change cameras in this case.
It looks like if you disconnect this, camera behavior will change, disconnect that and see what happens :slight_smile:

@mindbrain

Got it figured out! Now for a 2,3,4 player game, the camera view switches back to player 1’s view becuase thats the camera component on the game piece blue print. I want the camera to connect to the other players when its their turn, would each mesh or player have thier own camera component or how do i get the camera view to switch to player 2 when player 1 is done. THANKS!

Hey @lmesing7!

So there are a few things you can do. The primary issue is going to be switching to the next player accurately. For that, you can make an array of the players, possibly stored in “GameMode”. Or, you can hard get them using:

“Get Player Controller <0-3>”,
get player pawn from that,
get component-> camera,
set view target with blend.

I think that may be the most reliably easy way to go about it.
I would just include this wherever your code for switching turns is. :slight_smile:

Thanks. I just cant seem to figure out how to get the camera to switch to the next player. Ive tried your idea but i may not have done it correctly cuz it could not get it. Heres some images that might help explain.

Hey again @lmesing7!

So the new view target needs to be a camera, and it looks like another player pawn is being used in that spot. Have you tried this?

Also you can add a ForEachLoop at the spot noted in green, with players array as the input and using the array index, plug that into “Get Player Controller” to set the camera for each player!

image

@Mind-Brain THANK YOU! I FINALLY got it working! The for each loop helped! Now the player moves, I click end turn and the camera switches to the next player! Here a pic of the blueprint that made it work.
Set view target can’t connect to a camera though so that had to stay on array element.
This is on the CAM VIEW function thats called when the end turn button is clicked on screen.

Thanks so much for your help! I was stuck on this for a long time lol