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 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:
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.
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.
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).
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.