No announcement yet.

A tutorial for UMG buttons to change camera view in FP game

  • Filter
  • Time
  • Show
Clear All
new posts

    A tutorial for UMG buttons to change camera view in FP game

    I wondered if anybody could point me to a tutorial that might help me have buttons that change the camera view in a simple UE4.16 game?

    I have 5 buildings that I want the player to be able to wander around using a FP-style gameplay (mouse and keyboard). As the site is quite large, I'd like to have 5 buttons on screen at all times that, when clicked, will whisk the viewer to one of 5 selected cameras: one camera for each of the five buildings.

    a) when using the mouse and WASD keyboard buttons to navigate, how would you achieve a mouse cursor to click on the buttons? Is this even possible/workable? If not, what would be a better approach? Numbers on the keyboard (1-5) that move between cameras?

    b) a step -by-step guide to assigning behaviours to buttons would be fantastic: a day of searching has given me plenty of useful stuff, but I haven't been able to connect the dots into a workable solution.

    Any help would be massively appreciated.
    Kind Regards

    Hi there,

    well, a full tutorial don't exist for that. I try to answer your question (without BP's because i am not on my pc).

    In your Player-Blueprint create a custom Event, Name it like "ShowMouse". In this Event you Need the node "get Player Controller". From this node search for "set Show mouse Cursor" and set it to true. Then from the Controller node create another node called "set Input mode" in wich you choose UI only. With that you are be able to click on your Widget-Buttons.
    Of course you Need a back button that fires then a Event where you set Show mouse Cursor to false and set Input mode to game.

    For the cameras there is a way to blend between them. Create in your widget a custom Event for every camera. In that Event you have to call "set view target with blend".

    I hope this info help you out.
    01010100 01101000 01100101 00100000 01110100 01110010 01110101 01110100 01101000 00100000 01101001 01110011 00100000 01101111 01110101 01110100 00100000 01110100 01101000 01100101 01110010 01100101 00101110 00100000 01010100 01110010 01110101 01110011 01110100 00100000 01101110 01101111 00110001 00100001 00100000