To be more precise, Can I get one actor to toggle the visibility of a widget of another actor?
If so, how exactly?
To be more precise, Can I get one actor to toggle the visibility of a widget of another actor?
If so, how exactly?
Can I get one actor to toggle the
visibility of a widget of another
actor?
But I sense your question has less to do with widgets and more to do with actor referencing.
There are so many different ways of passing data between blueprints - you’ll need to very precise regarding what needs getting where and to whom if you need a concrete example.
Okay. I have a ship actor. I give it a widget component that is hidden in the game, and I want it’s visibility to be toggled on or off based on that ship actor.
The thing is, as a set up I have the other ships are all children of the one ship I made. Will this be a problem?
I have a ship actor. I give it a
widget component that is hidden in the
game,
Sure, makes sense.
I want it’s visibility to be
toggled on or off based on that ship
actor.
What does it mean?
So if I press a button, the HUD should toggle on, displaying the widget component of the other ship, and should toggled off after I press it a second time; hope that’s good enough.
displaying the widget component of the
other ship
Makes sense.
Ship or Ships are spawned dynamically.
Wouldn’t that just work then:
Each ship can push data into another ship.
I’m sorry I’m not being clear enough; I meant to say the widget component is the main obstacle here.
I already have the ships spawned on the map, plus I know how to spawn them in the game dynamically, So I think I’m set there.
What’s been bugging me is the widget component and getting the other enemy ships to display. on the screen or HUD. I hope I’m not losing you
also about the second picture, I’m confused … so the player ship is spawning the enemy ship and the enemy ship is spawning the player ship, again???
Ship or Ships are spawned dynamically.
vs
I already have the ships spawned on
the map
So which one is it? Hope you understand my confusion These two statements contradict.
If both ships are already on the map, the communication is trivial:
No, you said that both ships are spawned dynamically… so that’d be the blueprint that spawned them.
Okay I tried it but it didn’t work; I will show my setup in few.
Here is my Ship(The Ship I control)
I might not need the Sequence Node but I just wanted to see if there’d be any difference.
And here is the Enemy Ship
Not sure why you’re posting all this but I can’t see anything I suggested here.
We’re talking about a single variable that you point at an actor in the world… and you’re done. Once you get it going, you can continue working with the rest.
Perhaps you should consider following what I proposed. Or you did and it does not work? Sorry, but I can’t see the critical bit above. Most of the script you’re showing is just not relevant at all.
Is it Ship Targets? Did you assign the enemy ship from the world? It’s the 2nd pic.
Could you show how you’ve assigned it?
Yeah I did it like you said and it didn’t work.
and yes the Ships Target is the variable for the other ship.
it didn’t work.
This is not descriptive enough, sorry. If you need help, you really must try a bit harder. Grilling someone for info is no fun at all
So what exactly does not work? Use Print String, Breakpoints, Watch pin values and use Debug Filter to observe data flow. Did you try any of this? Do you see any warning / error messages in the log?
What is Target Indicator - the enemy’s Widget Component? Do the nodes fire? Is the widget set up correctly?
OMG I did not think of doing the print string part; my bad.
Yes Target indicator is the Widget component for the enemy
All of the other nodes used are not relevant, you’re right.
Okay so I managed to get the widget to display.
The Widget Component Rendering settings had Visible and hidden in Game both set to true, and I think that may have messed things up a bit. I cannot believe this, I feel so dumb.
Okay so I have one ship to display the widget; and you’re gonna hate me for this because I now want to be able to display the widget component for all the ships currently in the world. Now I realize what you mean by the Communication is trivial.
To do this I assume I’d have to use a for each loop and cast to node, but I know I’d be missing something here.
So I had an Idea, haven’t done anything with it yet but I would like some feedback on this: is it possible to have an actor that spawns a sphere that detects all the actors within the bounds of that sphere? This way I won’t be turning on all the widgets for every ship in the world, only the ones that overlap that sphere that was spawned?
I hope the point was to show me how to do it step by step by simple things first in small increments before getting to the more complex ideas because if so it is working,