Constant casts from a widget lag my game

I am making a farming game on Unreal Engine 4.27.2, where time only moves when the player does, which is achieved by having a timer in the FirstPersonCharacter blueprint.

However when I tried to make a clock widget to keep the track on the time, my game started lagging more the more I played it, because of the constant casts to FirstPersonCharacter from the widget.

Is there any other way to get the timer value?

1 Like

If you create the widget from the player, you have a reference to it, and can update the clock from the player. No need to cast or use a bind.

2 Likes