#Save the reference after creating, and
1 messages · Page 1 of 1 (latest)
Huh that's weird, I think your method should work but it still has issues
If anything I can set up a dm or vc to dive a bit more if you feel comfortable @sleek pike
you forgot to set HealthBar after Creating widget
drag from Return Value from CreateWidget and Set HealthBar
then Add to viewport and now it should work
ah so like this? It still has issues however
what does Initialize do inside widget and how do you spawn your character?
if on respawn you're creating a new pawn it's going to lose that reference to that UI Widget, you need to remove the widget when the pawn is destroyed and then create a new one when it's created
or you could get all widgets of class
Oh, Qwigs is right, its not the same pawn
So call destroy widget on EndPlay, if i'm not mistaken
the initialize is basically showing all the health progression and display them in texts, the respawn is just casting the ThirdPersonMode bp and then just spawn the actor
Event Destroyed for a pawn (actor)
Oh okay I see, so ugh...I just create the function just remove all widget...I don't know if that's also a way or not, but it seems to work
@hoary wigeon @sleek pike
you can remove the referenced widget on destroy on the pawn
it'd be better to get all widgets and target the (one?) HUD class you're using than remove all widgets
ah I see, sorry I'm still learning at the moment, so would the function looks like this or am I doing something super wrong lol