I need to know how to save the generation of an actor from a widget via a button.
keep me a photo if you can.
o/ Can you please specify what exactly you mean ?
If you want to spawn actor in world after a button is pressed on UI, and store it’s reference, try:
- Add a Button widget in some UserWidget, then add this user widget to screen being Visible
- In this UserWidget Graph create OnClicked event, hook to it SpawnActor from Class node
- specify Class from dropdown (magenta pin)
- 1 specify location in SpawnTransform pin (I’ve set 0.0 location by RMB clicking on pin → SplitStructPin)
- 2 RMB click on ReturnValue pin and choose Promote To Variable - this will create variable of type Actor and automatically assign spawned actor to it after clicking the button
NOTE: I’ve set collision to AlwaysSpawn
this way after clicking button and succesfull spawn, you will store newly spawned Actor reference in variable for later use