Cannot get updated int value in another blueprint

I am stuck in this simple problem. I am trying to access an int variable of an UI widget blueprint from the player pawn blueprint but i am not getting updated value. Please help. Thanks!!


timer2

rather than searching for the int every tick, why don’t you just use an interface to send it when it’s ready?

Its a timer, so i want the value every second

Can’t you run something like Game Time in Seconds (sorry if that’s not correct, doing this off the top of my head rn) inside your widget rather than, again, having two tick events?

image

This is creating a brand new widget every frame - probably 120 or so every second, for the rest of your game. You probably do not want that. This will leak memory and crash, and if you try adding them to the viewport, there will be thousands of overlapping widgets after 1 minute.


Its a timer

Not really, this is flooding the latent system with redundant requests 120 times per second. So it’s a timer, just not a good one.

If you want a timer, use a timer:

This will add 1 to the widget’s variable every second. The timer can be inside the widget, ofc. Up to you.


Consider telling us more about what you’re trying to do - there’s a chance a neat way exists to pull it off.

2 Likes

I am trying to check if player has reached certain score before the time runs out. I am relatively beginner and trying my own things out. Thank you very much for your kind suggestions. Will reach out if help needed.

1 Like

Timer variable is showing two values at the same time.

Input pin of set timer by event is connected to event beginplay.


I am trying to reset timer and score after player passes the level.

checking value of timer.
timerbug3
Output seen on the viewport.
timerbug4

All codes are in the same blueprint.

Seems unrelated to what is shown above. If you see 2 values, you are probably doing somewthing twice, or have another blueprint that duplicates the behaviour.

Connect the print to the custom event after - - node, it will be easier to monitor it. Watching tick spam it may lead to inaccurate conclussions.

Still showing same results, haven’t done anything twice.

Tick fires once per frame. The issue is elsewhere. We cannot see it in the screenshots. Please double check other actors, they might be tick printing something.