Announcement

Collapse
No announcement yet.

Create button for actor interface

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

    Create button for actor interface

    Hi guys,
    I'm new to UE and so far I love it however I can't figure out how to do something and since search didn't helped I decided to ask here.

    I'm making a blueprint actor for small grass patches that are placed manually in the level and you have the option to choose different meshes, different scale and different rotation for each instance that's placed in the level.
    Now I would like to have a button that when pressed it randomizes some of these properties but I can't manage to find a way to create a UI button using blueprints.

    Randomizing the properties is not the issue and I can get a the same functionality if I use a bool that I toggle on and off but having a button to press on the actor interface would be more pleasant.

    Thanks,
    -Adrian
    PLANET ALPHA

    #2
    I did a tutorial for a basic button setup for your HUD class. Take a look, it might be what your looking for.

    Button Tutorial


    Edit: Are you referring to a randomize button inside the editor? or in game?
    Last edited by pattym; 07-20-2014, 12:43 PM.
    Looking for blueprint tutorials? Then visit my blog... voxagon

    Comment


      #3
      Hi pattym,

      Thanks for the help but I probably didn't explained well enough - I'm looking for a way to create a button on the actor user interface to randomize it inside the editor,
      here's a quick mock-up of what I'm referring to:

      Click image for larger version

Name:	RandomizeEditorButton.png
Views:	1
Size:	15.8 KB
ID:	1052720

      -Adrian
      PLANET ALPHA

      Comment


        #4
        So I guess there's no way to do something like adding a button on the actor UI to trigger an action inside the blueprint?
        PLANET ALPHA

        Comment


          #5
          Not that I'm aware of, there probably is though as I believe the whole UI for the editor is done in slate. Your best bet would be to toggle a bool as you mentioned in your initial post.
          Looking for blueprint tutorials? Then visit my blog... voxagon

          Comment


            #6
            So to make a button on any blueprint actor, what you want to do is add a collision box inside the blueprint.

            Make sure your player controller has mouse events and mouse click events enabled (I assume this is already true).

            Next, in your actor blueprint event graph, add an OnClicked or OnReleased click event to your collision box and bam, button inside actor. To make a background for said button, you can use a billboard image or a 3d mesh.

            Comment


              #7
              We are planning to add a feature that will let you expose Events in a BP as button in the detail panel, much like i think you describe! Hopefully we will get to it quite soon (probably 4.5).
              Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
              Twitter: @EpicJamesG

              Comment


                #8
                Hi Levon, thanks for the suggestion but is not exactly what I need.

                James, that sounds awesome, keep up the great work guys!
                PLANET ALPHA

                Comment


                  #9
                  Ah yes, my fault for misunderstanding, hopefully you find a solution or it gets implemented.


                  Originally posted by JamesG View Post
                  We are planning to add a feature that will let you expose Events in a BP as button in the detail panel, much like i think you describe! Hopefully we will get to it quite soon (probably 4.5).
                  That sounds like a great feature!

                  Comment


                    #10
                    Originally posted by JamesG View Post
                    We are planning to add a feature that will let you expose Events in a BP as button in the detail panel, much like i think you describe! Hopefully we will get to it quite soon (probably 4.5).
                    Hmm, when would that be? Getting excited..

                    Comment


                      #11
                      >Hmm, when would that be?
                      >about 4 lines of code to expose buttons in bp's
                      >almost 2k19
                      pff

                      Comment


                        #12
                        this is available for a while, just create a custom event in your blueprint, and check on "call in editor", after compile, a button will appear when you select your blueprint in the level editor.

                        Only restriction is that a custom event cannot have any inputs, but you can set those separately as exposed variables.
                        Attached Files

                        Comment

                        Working...
                        X