Home Unreal Engine

Showing Widget/texture2d via button press?

I'm currently trying to make a mechanic where when I go near a note, a note will pop up on the screen so the player can read it. I have a model of the note with a trigger volume on on it, and I want to make it so that when the player goes into the trigger volume near the note, they can press a button and the note will pop up. How exactly would I do this? Would it be easier to put the texture in a widget and make it so a widget pops up, or make just the texture pop up? I'm quite new to blueprints and have been stuck on this for a while, I haven't been able to any tutorials on how to blueprint this.

Replies

  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 18
    Blueprints are definitely the way to do this..although you didn't specify if you wanted the note to appear on the "HUD/UI" or "in the world" when the player steps over the blueprint.
    The simplest "in the world" solution is to simply add a "TextRender" and sphere collision components to a new blueprint class and use the event OnActorBeginOverlap to toggle the note's visibility, but that's probably too simple for what you want.

    Getting any sophisticated results, either in the world OR in the "UI/HUD" will likely involve using UMG (widgets). Adding stuff widgets is pretty easy though, so it's worth going through a few tutorials on UMG to see how the system interacts with blueprints and then readdressing your problem specifically with what you learn. The trickiest part with widgets is remembering to add them to the viewport and remove them--and thus keeping them organized if you have a bunch of them coming and going all the time, like in a full UI. For your problem, you won't have to worry too much about that.

    There's also a 3d UMG widget--which is a good "in the world" solution. It's actually a widget COMPONENT you can add directly to, and then interact directly with, within a blueprint class. This is still an experimental feature, but is a very easy (and powerful) to work with. It might need to be enabled in the project/editor properties tab, under experimental (unless its on by default now). Goodluck.
Sign In or Register to comment.