I need help with how to change cameras by UMG button using Set View Target with Blend?
Announcement
Collapse
No announcement yet.
How to Change cameras by UMG button?
Collapse
X
-
What's your problem exactly?
You could do several things:
a) Your blueprint widget has a reference to the new camera so it calls directly Set View Target when its pressed
b) The blueprint widget calls an event dispatcher when the button is pressed and levelblueprint (or other actor) assigns this eventdispatcher to the code for Set View Target with Blend
for a) I will try to explain every step:
* You must setup a blueprint of type Widget user interface. Then, add a variable (on graph tab) of type "Camera Actor", make it public and expose it on creation if you want. Then assign the desired camera on widget creation.
* Create the button on the designer tab
* Add an OnClicked event to the desired button inside the designer tab. Now it will redirec to the graph where you simply plug the Set View Target with Blend using your variable camera as input
b) is similar, just do the call to the eventdispatcher and whenever you assign the code do the Set View With BlendWIP Save the princess !
https://twitter.com/stp_the_game
-
well you couldn't change it directly using a widget button until 4.9 when you can cast to the level blueprint. But you could set up the camera changing to happen in the level blueprint and set it up to change on a keyboard key or mouse button press. Or even when you click or mouse over something in the scene.
I have a set up like this for a character selection screen im working on. Basically i have 3 cameras in the level and 3 target actors. I have references to these 3 actors in the level blueprint. When i click on one of the actors the camera moves from the main camera and switches to the new camera facing the actor. When i click him again it zooms back out . This happens for each of the actors .
Comment
Comment