So reading the error message:
“Accessed none trying to access” = means a nullpointer was found
“property TextGameResult” = this is the variable that was null
“Blueprint: WBP_GameEnd” = the name of the blueprint where the error is
“Function: Initialise Text” = The function where the null pointer is
“Node: SetText(Text)” = The node where the null pointer was caught
So within your GameEndWidget in the InitialiseText function you have a Set node for “Text Game Result” but you never “Select Asset” meaning you are passing a null value to the “SetText” node and thats where the null pointer is happening. Make sure you choose an appropriate value from the dropdown. Also I have a hunch you might run into the same error in GameStartWidget InitialiseText where you havent set a value for TextCountdown either.
But the countdown is still not working. The game should start with a countdown before it begins, but on play it still just starts immediately. I’ve done the same thing in the Start Game Widget that I did in the End Game widget, but to no avail
I see that you have SetStartDelay and Countdown functions. But I don’t see them actually called anywhere. Did you just leave those calls out of the post? In your GameStartWidget I see the Countdown function call node, but it never actually gets run cause there’s no execution flow going into it. Without seeing your whole project, for one I’m not sure why you need a SetStartDelay function that only calls a single node, you could simplify that and just call the “Set” StartDelay node without calling a function that calls the Set node. Second find a BeginPlay node that makes sense (again, not sure what your project looks like, how, when you want to start the countdown) and connect the Countdown function node to the BeginPlay node. EventConstruct is called even in the editor, but also when you start the game before the BeginPlay - we usually put game logic in BeginPlay vs EventConstruct (these are more for setups, stuff you already want to see in the editor before even playing the game)
To clarify, I am following the ToonTanks section of the course. The Countdown is intended to begin as soon as the game starts. The text GO! pops up after a set amount of time then is removed.
Now to be honest, I’m finding Unreal pretty tough to get my head around so for now, I’m just following along. I’ve checked time and time again and I followed the lectures to the letter to set this up, so I have no clue why this isn’t working.
In terms of implementation, the widgets are being called through this blueprint:
Great! With that execution taken care of, I am getting the InitialiseText function working fine, however no countdown is occurring. The ‘Get Ready’ text just stays on the screen now. I imagine the problem is at Initialise Text or at the Countdown functions:
Hmm… I don’t see anything glaringly obvious… I am a bit skeptical about the TextCountdown variable, in InitialiseText are you setting it to itself? Why? Or are they separate vars, then name them a bit different, you might be calling functions on different variables. Put some PrintStrings here and there to see where execution is/is not flowing, print out the variables to make sure they are what you expect them to be.
If you’re still stuck, let us know what you tried and a little more info - I think it’ll be in the BP vs code.
The TextCountdown Variable is the string that comes up showing the “Get Ready!” text. This should then change to a countdown until time expires, and then “Go!” comes up on the screen.
I don’t know what else I can do at this stage. This part of the course really confused me and I might end up restarting everything at this stage if I can’t find a solution. I don’t know where else to turn. Everything is EXACTLY as described in the lectures on the widget setups and there should be no issues in my code.
The issue was that I was passing in TextCountdown into the Set Timer by Function Name. Once that was removed, everything worked as intended! For anyone who might have this issue, this is how the widget for InitialiseText should look like: