Using UUserWidget for floating health bar in ToonTank Project

In Toon tank homework I want to implement a floating health bar for the PawnTurret. I follow this:

https://www.youtube.com/watch?v=nNe-NSrtYUk&feature=emb_title.

So, I create a class derived from UUserWidget:

Captura de pantalla 2021-02-21 154035

and derived this one to a Blueprint:

Then, I declared a WidgetComponent in my PawnBase to access from my PawnTurret or PawnTank:

*.h
Captura de pantalla 2021-02-21 154521

*.cpp

When I edited the WidgetComponent in the Turret blueprint I can configure it without problems. The real problem is when I compile and save the Turret blueprint that the WidgetComponent is kind of empty.

The strange behavior goes away when I comment the *.cpp line above, compile, uncomment, and compile again. I can configure the WidgetComponent, but when I compile and save the Turret blueprint the same problem occurs.

Replied on Udemy

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms