How to pass a Int Var in Actor to HUD
Hi, Im new to Unreal, im trying to make a 2d Click game, for this i create an Actor and when i click this actor, it add 1 to my var, this is working, the problem is i trying to show this var in the HUD, but a can't do, I searched tutos but its only for players character, never to actor, so im bit lost. Anyone know how to do it? in the game i dont have a player, since its only clicks, so i think this might be the problem too.
asked Oct 05 '16 at 05:51 PM in Blueprint Scripting
One way you can do this is to use the Get All Actors of Class node in your widget to find all instances of your actor in the level, then use a Get node from the output array to find the specific instance of the actor required. The issue with this method is that if you have multiple instances of the actor in the level you will have to determine which one you are getting from the array.
Another method would be to, when the actor is clicked, pass the int from the actor to a corresponding variable in your Controller. You can then use the Get Player Controller node in your widget to access the corresponding variable which should contain the value from the actor.
answered Oct 05 '16 at 09:11 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here