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.
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.
Yeah in this case it’s just one ship; would like to add more ships later down the line, but I need to focus on just getting one done first.
I don’t want the option to select other targets. I think that would make it a bit more complicated to I wanted to start with a simple goal of displaying the widget component of the other ship. So for now, it’s just one.
I at first thought you won’t really have to know which one to shoot at; just aim and shoot, like in an FPS. So it’s not quite like a Ace Combat or Air combat sim because while I want this for my game, it is not the ultimate goal of the project.
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???
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.
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,
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?
I now want to be able to
display the widget component for all
the ships currently in the world
If this is really what you need and you really mean all of them then Get All Actors of Class would work well. No casting necessary as this filters it out: