Hi. I want spawn object when i press button on my UMG.
I made event from spawner (simple bp object on scene) and it is work properly
My UMG widget have a variable class of my spawner.
But where I can set a reference to my scene spawner?
Hi. I want spawn object when i press button on my UMG.
I made event from spawner (simple bp object on scene) and it is work properly
My UMG widget have a variable class of my spawner.
But where I can set a reference to my scene spawner?
If you enable “expose on spawn” (a setting for variables) for this reference you can provide it when you spawn your widget if you have that reference somewhere.
If it should only trigger when you select that spawner you should save the variable you get (via “get hit result under cursor” and there when you break the hit result the other actor) in your player controller or player state and use that as reference.
If you only have one spawner at any given time or always want to interact with all of them you can use “get all actors of class” which will return an array. If you always have only one just get the index 0. Otherwise do a for each loop and spawn at each spawner.
If none of this helps please let me know what exactly you want / need.
Cheers