Hide HUD after interaction

Hi guys,
I am working on Door Opening Blueprint and the mechanism itself works fine. Nothing to worry about.
Now I want to add some kind of a tooltip that tells the player which button he has to press. After several attempts, this works, too … but I want it smoother.

I want the tooltip to disappear, after the player hits the E button. Later, when he comes back, the tooltip is where it should be. For this I thought I could use a simple boolean variable. Is the timeline finished, the variable is set to ‘true’ and this enables the ‘Remove from Parent’ node.

Well, I was wrong and I can’t figure out a solution. What is the best way to achieve this?

Thanks for your help in advance!

Best regards,
gestoryscht

One thing that might be your problem is it will execute multiple times, because it is in the tick event. I would move it so you directly call the nodes, and just promote the widget to a variable.

something like the below picture should work for what your looking to do. it may look complex but its actually rather simple. when the player overlaps the collision volume the variable near door is set to true (i used this to control if the input should be executed, a gate would also work) then a widget is created and added to the viewport. the do once and delay are just to make sure that duplicate widgets arent created which has been known to happen in a setup like this. on end overlap its basically the same. as for the processing of the input its very similar to your script but when the timeline is done it also activates the remove from parent. the door i made is also auto closing cuz you know why not.

First of all, thanks for your help. I really appreciate it.
I am a bit nooby in terms of scripting, so this is a great help to learn more and I think I have understand what you did there. But I have few problems with this, but I think you can solve these easily.

First problem:
What is this Widget for a variable? I created a new variable as a Widget Object Reference, but is doesn’t wan’t to connect to the ‘Add to Viewport’ node.

EDIT: First problem is solved. Promoting the Return Value of the Widget Node did the job.


Second problem:
The door animation won’t work, but I think this is because of the Timeline Graph. My old Timeline was set from 0/0 to 1/110. Obviously this does not work, so I changed the 0/110 to 0/1. Doesn’t work either. 0/100, too. How does the graph looks like?

Thanks for your generous support.

EDIT2: Oh, and I’ve found a bug and I am really sure this is a bug, because it’s hard to reproduce it.
Sometimes, when I am in front of the door and pressing the E Button several times (like 10 times in a row), the HUD decides to stay on top for the whole time and you can’t get rid of it.

Well, this isn’t a real big deal, but it would be nice to remove this undesired effect.

Did your door animation work before? If it dis just so ot the way you did it. In the graph i did my timeline was just a zero to one over three seconds. Thats just the way i do things like this so its easier to troubleshoot and to modify the values if needed.

As for the bug you mentioned im not sure on that one unless you disnt put in the do once part of the script. I would think the overlap bugging out would cause that issue but you say ots when you press e alot so im not sure without looking deeper into your script

After several attempts to get your door animation work, I’ve figured out I need at least the ‘Enable Input’ node, connected to the Event Begin Play. It seems some kind of logical, because now the games knows when to run the script … I think you didn’t implemented it, because it was so obvious?
Well, I am a complete noob after all :smiley:

Anyway. It ‘worked’ but with some strange behavior. After the first button press the door snapped immediately from the start rotation to the end postion and slowly back - while playing the animation.
I couldn’t find the error so I implemented my version of doing and now the door itself works.

Okay. Next to the HUD … this works … somehow.
I think when I lower the delay after DoOnce, multiple widget gets created and this is the ‘bug’ I showed above. When I set it to 1 second, it works fine. Even with 1 second this behavior appears when I spam the E Button, but this fits for my needs, because this will be never an actual game.

Anyway - thanks for your help!

Nope, nope, nope. The problem isn’t solved and I found the issue - but not the solution to fix it.
The script works perfecty fine, when the ‘Hidden in Game’ checkbox of the Box Collision is unchecked. When I Hide the Collision, the door itself works fine BUT the HUD is visible all the time.

EDIT: Okay, sorry for the mass of edits, but now it works. And sometimes it doesnt work.
I am a bit confused. I do nothing and with every ‘Playthrough’ it changes.

setting the collision to hidden in game should have no impact on the script so your bug is pretty weird. post a new picture of your script and ill see what i can find out.