Announcement

Collapse
No announcement yet.

Changing Camera with UI Button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Changing Camera with UI Button

    I am trying to use a UI Button to change cameras, but I can't access the cameras in the level from the Widget Blueprint. Does anyone have an idea how to accomplish this?

    #2
    You could create camera array variable inside Game Instance and add cameras to the array inside the level blueprint, that way you access them inside the widget blueprint from Game Instance.

    Comment


      #3
      It's pretty easy, and a way described above is madness

      Comment


        #4
        Why can't you access the cameras in the level from the Widget BP? You can always use "Get All Actors from Class" and get all Camera actors in the level. I'm not saying it's the best way, but it's possible.
        Take a look a this quick example:

        Click image for larger version

Name:	cameras.png
Views:	104
Size:	135.7 KB
ID:	1462876

        It will get all cameras in the level, randomly select one and use it.
        "I have harnessed the shadows that stride from world to world to sow death and madness."

        Comment


          #5
          I didn't realize that was a possibility. (I'm still very new to UE) I'll keep that in mind if my current solution causes problems. Currently, I'm using an event dispatcher to send the on clicked event to a different blueprint where I have all my camera switching logic.

          Thanks!

          Comment

          Working...
          X