Why has my blueprint stopped working correctly?

Hi! Last time i asked about somethign related to a checkbox, and i finally solved it here: How do i interact with a checkbox?

Now, i created a new project, tried doing the same thing and it doesn’t work the same way… i just don’t know why. It’s bassicaly a checkbox to interact with pressing the key E, and now it only is hittable by its… back?. Here are the screenshots:

Character BP

Checkbox_BP

Test:

Why did this happen?
What am i missing?

Thank you in advance!

Hey there @Merrickl! Could the background UI element be absorbing the hit? You could try making the background non-hit testable like this. It’s usually for the cursor and not traces however.

So if that fails, I’d change the Zorder of the checkbox to make sure it’s not on the same level as the other UI:

image

and if THAT fails, you can instead of doing a single line trace, do a multi line trace. That will work regardless, but is less efficient.

Hi! Thank you for your support!
Sadly neither of those options worked.

I’m stunned by the result, why would it detect a hit by its back?
Here’s a video of the SAME code but in a different project, and it works as expected:

Hrm, can’t seem to replicate the issue itself, may I see the widget actor settings?

See my last comment in the previous thread. You’re using Get (all) Actors of Class - this will never work. Wouldn’t it be neater (and easier) to use the suggested Widget Interaction Component:

image

You wouldn’t need all that script and also get the proper interaction which evokes the other behaviours, like enter / leave and focus propagation. Consider it.

1 Like

Thank you very much so far.

I tried it. Still doesn’t work.

What would the code for ActorBP and WidgetBP be?

I tried as following and some variations but still can’t get it right.

Am i missing something now?

FPC BP

Do not connect Key pins - see my example. A checkbox has no idea what E means. It only knows what LMB is. Use E, just do not connect it.

What would the code for ActorBP and WidgetBP be?

You do not need any other script, the Toggle, the component hit (unless you need physical interaction with the widget).

Also, do not use Get All Actor of Class, you never need it unless you want to do something to ALL actor. You have references to the OnComponentHit node itself. Not needed here but that’s what they are for.

Hey Everynone, i really appreciate your help, it finally worked :raised_hands:

I’m really new to using UE5 since all my career has been dedicated to psychology and mental health, not programming, lol. So thank you very much for taking your time to explain! To you too SupportiveEntity!

But… just for clarifying, since a checkbox doesn’t know what E means, does it only work with clicks?

  • if you put a print string after E, does it print?
  • can we see the widget hierarchy, perhaps something is blocking the trace?
  • could you also show how the interaction component is set up?

But… just for clarifying, since a checkbox doesn’t know what E means, does it only work with clicks?

It works with everything. But we’re sending it an E simulated mouse click. The checkbox only understand on / off.

I replied it didn’t work at first because i screwed up following up the instructions. Then i retried and it worked! so i edited my answer. Apologies!

1 Like

Awesome! One issue you may run into could manifest if you ever place those checkbox widgets so close that they start overlapping. Avoid it if you can.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.