Hi! To whoever this reaches, I am having some trouble with my code. This coding website is still very new to me, so I don’t really know how to use it. I tried to follow a tutorial but when I tried to do the game update block, it always said, “Program Error: sim error: failed cast on null”. Can you please help me?
Hello! Welcome to the forums!
I think I know the problem: You see, since Tim is created 4000 ms after the game starts, the game attempts to make Tim’s sprite do something. The problem with that is that, when the game tries to run that code, Tim doesn’t exist yet, and the code doesn’t make sense to Makecode.
For solving it I recommend either
Taking away the “after 4000 do” block (but I’m guessing the purpose of that is to showcase the title screen for a few seconds.
or creating a variable that becomes 1 when Tim is created, and then running code in the “on Update” block to check whether this variable equals 1.
Hope this helps! If you have any doubts, just @ me.