How to Change Cameras by UMG button?

Hi,
i want to make a house in Unreal and switch the Cameras from one Room to another by clicking a Menu Button.
(Example: Click on Button “Floor” = Camera Moves to a static Perspective in the Floor)

how can i do this?

3 Likes

First of all set all these cameras’ reference in your GameMode on EventBeginPlay of your Level BP. Now , use your game mode in your widget to get reference of camera on the umg Button click and use “Set View Target with Blend”. This will change your camera to the other camera with a very smooth movement.

sorry ambhar, but i work for only 2 weeks with this engine. :frowning:
maybe you can explain a little more detailed how to do it?

thanks! :slight_smile:

You have added different Camera Actors for different rooms in your Level?

  1. Add cameras in your Level

2)Open your Level BP and get reference to these cameras.

  1. Go to your GameMode BP and add variables of type Camera Actor (As many variables as their are cameras in your level)

57750-gamemodevar.png

  1. Go to your Level BP and Set these Game Mode variables value with the cameras that you have created in your level. Like Below :

  1. Now go to your widget BP, on Clicked event of button, get reference to Camera in your game mode and set it as active camera like below

Now you can set buttons for different camera views likewise.

1 Like

thanks! it works! =)

But there is another problem:
When the onclicked event starts, and the camera moves slowly to the assigned perspective, the user is able to click the other buttons, which interrups the current camera flight.
Is it possible to block all user mouse events during the camera flight?

You can remove widget from viewport and add it back after camera is moved to new location. Also please mark the above answer as solved for future reference.

hey ambhar. ok. with “remove all witgets” after “Set view target with blend” the Menu disappears, but how can i get it back after the camera flight?

“Remove widget” before “Set view target with blend” and add it again using create widget and add to viewport node after “Set view target with blend”. You can use “Delay” node to set delay of few seconds before adding widget to viewport

Please mark this answer as accepted so that future users with same problem can access it.

Thanks
AB

Hi everyone,

So I used this method to create an interactive camera view mode. So far everything is working well. I can jump inside the widget and play around all my camera that I set in the widget blueprint and level blueprint, but I got only one issue. When I quit the widget and resume the game mode my character is locked to the camera and I don’t have any movement available. I tried a lot of blueprints options but I didn’t find the solution. Maybe it is something inside the camera itself because the resume button in the widget is the same that I used inside the main menu and pause menu and they work perfectly. but I didn’t see an obvious settings to change inside the camera. I tried to set back the camera view to the camera inside the first person character blueprint with the cast node, but this didn’t work either.

Here is the thread that I post in the UE4 forum, but look like anyone found a solution. [link text][1]

Here some pictures of my setup :

Exit button in the widget blueprint :

Here I tried to cast to the first person character blueprint (didn’t work) :

My level blueprint setup :

Widget blueprint setup :

Thanks for your help in advance.

hi ambhar!
I created a 360 camera for my project and I would like to switch from one to another, is there any way to do it?
this is my camera

Set View Target with Blend and pipe in the desired camera actor as New View Target.

Thank you so much omg!