Why I can't click any buttons in my widget?

Hello G1K777!

Did you check your button’s Zorder? Maybe it’s the main problem.

1 Like

I’ve created a “Death Screen” widget, where people can press a “respawn” button. The problem is that i can’t click this button.

The cursor is showing but i can’t click this respawn button.

This is inside the widget blueprint.

  • make sure you’re using something different than Input Mode Game Only
  • check widget hierarchy and see if the root of the widget is set to something other than Hit Test Invisible and the chain of elements that lead to your button allows for the click to tunnel through
2 Likes

Can you try with Print String node in order to debug after pressed node?

I set it to 100.

You triying on Pressed? i have this problem and solved with pressed.

I created a simple “ESC Menu”, i made a “Quit game” button and it works for some reason. I did the same on my “Death screen widget” and it doesn’t work… yay.

FlyingPawn (character)

Death function connected to “tick”

Death function connected to “tick”

@G1K777: If your Death function fires on Tick, you’re creating a new widget every frame. Do Once does nothing there, when the function goes out of scope, the node resets.

Why do you fire it on Tick, wouldn’t it be more efficient and logical to fire it every time the player loses energy? Asking, as you may have other reasons, of course.

As I said, you should try it via Print String node for debugging. Maybe cast fails when you are trying to cast to the player. Just unlink all the cables from respawn button and connect to the print string and check it. Maybe button is working but your code is not working.

Never thought about that, good idea!

It worked! That was the issue, i should have put the death function behind the takedamage function. It works now fine. Could you please tell me how i can stop my plane from moving and disable the input till the player respawns ?

Could you please tell me how i can
stop my plane from moving

That would depend on what your plane is and how you’re moving it. There’s like 50 ways of moving things around in UE4.

You can disable input by using Player Controller’s Disable Input node and targeting the actor that is handling the input.

Why you should use Death function on Tick? You should use a Custom event or function that fires when the player dies, on Player recibe damage, if life is lees or equal to 0, fires the event DEATH. Check in every tick if the player die is heavy cost.

I was trying on clicked, which didn’t worked. OnPressed works, but I don’t know why.

Hey men, I made a simple game when the player is Dead the Widget Switcher switch the widget from player info like health and coin Etc. to widget have some buttons to press, the problem is I CAN’T PRESS ON ANY BUTTONS, and I didn’t find any Solution.

Start a new thread, post script and a detailed description. No one can possibly guess how you set things up. :slightly_frowning_face:

Sorry I asked more detailed question.