So I have a camera system set up but I need a button to exit the widget and return to the player camera but none of the index numbers bring up the player’s camera >.>
How do I directly reference the camera to return to the regular player view? The “EXIT” button below is what I want to use to close out the widget and return to the player camera.
Or is there a better way to close out the widget and just reset the view to the player? I just want to click the monitor, open the camera to access the other cams, and then click the button to close out the widget view. The cameras work as intended, but it seems like my current method of opening and closing the widget are a bit janky… as seen above.
It would be easier to help if you showed the function where you actually switch the camera based on the number. The nodes you have shown above only shows that you set an integer, which wont help debug the camera switch.
I have them saved in the “Cameras” variable with the array modifier tagged. This is specifically the “Camera Actor” variable type.
The way I reference the cameras is by using the array variable with a “get” node, and attaching an integer node to the get node from the “Change Camera” custom event, which sifts through the referenced camera array to get the index numbers from the actors physically present in the scene. Wait a second. I’m an idiot for not thinking of this before. Now that I spelled it out myself, I am thinking the problem may be that the blueprint referencing camera “actors” which have to be physically in the level, but my player camera only exists within the player character.
Unless there is a way to reference the camera that is only applied within the player character viewport in a blueprint, I will have to try using a camera actor for this later when I get back home.
EDIT: Dang, that doesn’t work. I can’t just drag the camera actor into the player character to use it that way.
What if you where to use a Tag system to get the cameras? Each camera would have its own tag (eg Camera1, Camera2 etc) and in your blueprint you would do something like this:
So tagging the player camera does allow me to use my rotation inputs when I return to it whereas that was not the case last time if I recall, but the camera view still does not return to the actual follow camera which is added directly to the player character. Taking a closer look at the player object, I can see that when I use a button to return to the player camera, the camera view actually returns to the center of the player capsule, where the arrow is pointing. I have no idea why, though. I tagged the camera within the player character viewport and referenced it, but I get the same result if I click a button with no camera reference at all.
You can’t find the character camera because is not added to the camera array on begin play. Try setting the array as an Actor array and add the player character to it on begin play.
I did almost all of this though I just don’t know what the “self” reference specifically refers to in the first photo. I tried adding the player character node to it but that didn’t work, and the “self” node variable from the dropdown list does not attach to the add node.
On my screenshots you can see that they are from BP_ThirdPersonCharacter in the top left corner:
This means that the “Self” is a BP_ThirdPersonCharacter…
…but my Camera Array variable is of type Actor so I can add both the main character and the camera actors in the level.
By the way this is all done in a brand new third person template with only two camera actors added and those blueprints. It should take you about 10min to reproduce it.