i have a timer that reads the minutes and seconds from a separate actor and shows them in a widget
(widget code, same for seconds)
(reference to timer)
(error)
any reason why this is happening?
i have a timer that reads the minutes and seconds from a separate actor and shows them in a widget
Your timer ref is not pointing at anything.
i’ve set the get all actors of class to my timer actor with the first script inside of it
i followed a tutorial almost exactly (the only difference being i put my script in an actor whilst he upt it in his firstpersoncharacter) (Countdown Timer | End Game Screen - Unreal Engine 4 Tutorial - YouTube)
How that error works is: click the word on the end of the line and it will take you to the node that’s getting the null reference.
( I know you know that ).
But the point is, it is null, no matter what you think
So, I can see you setting it up there ( btw GetActorOfClass just gets one ). So it can only be one thing: there is no timer.
How can that be, right? Timing ( probably ). Try putting a delay in the construct event, and give the system enough time to create the timer actor ( if it’s a timing problem ).
Also ( unrelated ) here:
Putting a delay on tick has no effect. Tick is called every single frame. So if you put a delay of a second there, all you’re doing is holding off all the tick events for one second, and then you get all of them with no delays.
putting a delay in the construct event didn’t work, no idea how the author got it to work
Putting a delay on tick has no effect. Tick is called every single frame. So if you put a delay of a second there, all you’re doing is holding off all the tick events for one second, and then you get all of them with no delays.
that’s how the timer works, the delay is for the branches to update the minutes / seconds depending on their value every second (e.g if the seconds is set at 59, after the delay it will be set to 0 and the minutes will be set to 1 to signify a full minute passing)