Simple Question

Hello, i want to connect these two connections. If you know, please show me how to.
I tried to create a boolean but in the widget they don’t recognise it. Create an event seems complicated

Creating event / blueprint interface isn’t complicated. it’s the simplest way to do ut.

can u show me with blueprint please

thanks for responding me but an image would be appreciable please

There’s definitely a few ways you could handle this. Since you are trying to have the score become visible from the Character, let’s stick with that for now, to be simple.

  1. In EvilCharacter, it needs a reference to that overall widget that you show on the right side of your picture. (Score).
  2. Once you have that reference to Score inside Evil Character, call a function or event inside Score that is passing in the Score_Number object as the target of the SetVisibility function.

That way, EvilCharacter doesn’t need to worry about the Score_Number variable, only Score does.

There’s definitely a few ways to handle it, depending on the scope of the game, but if you’re just looking for simple functionality, that should do the trick.

Step 1: Inside of the character, s

tore reference to the widget

Step 2: Inside of the character, call a function inside the widget (using the widget reference we just stored)

Step 3: Inside widget, put whatever logic (e.g. set visibility) you want to happen to the widget component

There’s definitely many ways to do this, but you asked for the simplest way to go about it. If you were looking to challenge yourself, one direction you could take with this is to set up an event dispatcher has a bunch of events tied to it, and call it whenever the relevant logic happens.

For example, an event dispatcher that is tied to when a score should increment would call the score increment, a sound effect, and a visual effect. Event dispatchers/delegates make your life a lot easier.

Thanks for your support, what is suposed to be “Player Hud Widget Ref” ?

That’s the equivalent of the widget that you have called “Score”.

i can’t call him.

So, inside your Evil Character blueprint, you need to create a NEW variable, that is a reference to the score widget. My initial picture was a little unclear what to do with the return value after creating the widget, so that’s my mistake. This next picture shows that you are very clearly setting a new variable reference.

When you create the Score variable inside the Evil Character blueprint, it will need to a variable of type “Score”. You can then name the variable whatever you want as long as it is of type Score.