#DevilMuffins issue
1 messages · Page 1 of 1 (latest)
So, can you repost the question here, so everything is centralized in that thread?
ok
basically when i click the start button it doesnt load the game scene
im using these 2 packages if that helps
No errors in the console when playing the game?
(note, I've never seen nor used these packages, I'll try fetching docs as the convo continues)
when i click the button a little thing appears next to the game scene in the hierarchy saying "(not loaded)"
Ensure that Start is getting called first, by logging something inside of it
this is kinda a different issue but i thought maybe updating the visual studio package version would help but now its giving me these errors
The first one, it's not urgent. The second one, you renamed a script and Unity can't find it anymore. You'll need to re-add it again to the object that emits the error. Third and fourth one are internal errors, a good restart will solve them
ok thanks but how do i find the script giving the problem and when you say restart do you mean the editor or pc?
See if clicking the error highlights the source object. Same thing with a double-click.
And restarting the editor only should be sufficient
i restarted the editor and everything went away so i think its fixed now
that problem ayway the first one still doesnt work
So, back to debugging. Make sure the script is attached and enabled on an object.
it is
Next, make sure Start is getting executed
how do i do that?
sorry im not very good at coding im quite new so how do i Debug.Log something?
wait i did it
i put Debug.Log("HI") and it came up in the console
Okay, so the code is being executed. No other errors at this point? The one that could happen is a NullReferenceException
there are no other errors
Okay, then do the same Debug.Log, but this time in your StartButtonPressed method. In the meantime, I'm going to quickly scroll through the docs for all that UIElement thingys
ok thanks 🙂
they are both coming up in the console
when i press the button in the hierarchy next to the "Game" object it says "(not loaded)"
So if they're both coming up, then your button click is indeed getting registered and sent to the code
So, it's the LoadScene call that fails
Is that scene in your Build Settings? And most importantly, is it spelled right ("game" is not the same as "Game")?
the scene is "Game" and i changed it to that but its still doing the same thing
Are you sure it's not getting switched? The (not loaded) postfix tells me that the objects were unloaded, ie. the scene changed
i just realised how dumb i am :/
the ui is in the game scene so it is loading its just not removing the UI so i need to put the UI thing in another scene
sorry for wasting your time
Nah you didn't waste my time, you also learned how to do basic debugging