How do i look through another camera with wiget?

Okay @The_DecafEagle75

First make sure you have a camera actor added to your scene. (you can skip this step if you do)

Next we’re going into our game mode, adding a “Camera Actor” Object Variable and putting this code in. It’ll set our camera for the player controller to whatever Camera2’s variable is set as (we’ll get to that in a minute).
image

Next we’re going to the button “On Clicked” event. We’ll get the game mode, cast it to have it act as the game mode we’re using that we just put that other code on, and dragging off the “As:” pin we’ll call that camera switch function. Now we just need the game mode to know what camera has to be used!

Now we’ll open the Level Blueprint to set the game mode’s camera variable because you can’t call on the LBP like that, the LBP pushes outwards only (most of the time). So first we’ll get our camera actor on the LBP by dragging it in from the world outliner.

Then we’re going to get our game mode, cast it to the GameMode we’re using since that one will have our camera variable, and drag off of that to set your game mode’s camera variable. That should be it!

2 Likes