#DevilMuffins issue

1 messages · Page 1 of 1 (latest)

charred stump
#

So, can you repost the question here, so everything is centralized in that thread?

candid patio
#

ok

#

basically when i click the start button it doesnt load the game scene

#

im using these 2 packages if that helps

charred stump
#

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)

candid patio
#

when i click the button a little thing appears next to the game scene in the hierarchy saying "(not loaded)"

charred stump
#

Ensure that Start is getting called first, by logging something inside of it

candid patio
#

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

charred stump
#

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

candid patio
#

ok thanks but how do i find the script giving the problem and when you say restart do you mean the editor or pc?

charred stump
#

See if clicking the error highlights the source object. Same thing with a double-click.
And restarting the editor only should be sufficient

candid patio
#

i restarted the editor and everything went away so i think its fixed now

#

that problem ayway the first one still doesnt work

charred stump
#

So, back to debugging. Make sure the script is attached and enabled on an object.

candid patio
#

it is

charred stump
#

Next, make sure Start is getting executed

candid patio
#

how do i do that?

charred stump
#

Debug.Log something inside of it

#

See if it appears in the console

candid patio
#

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

charred stump
#

Okay, so the code is being executed. No other errors at this point? The one that could happen is a NullReferenceException

candid patio
#

there are no other errors

charred stump
#

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

candid patio
#

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)"

charred stump
#

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")?

candid patio
#

the scene is "Game" and i changed it to that but its still doing the same thing

charred stump
#

Are you sure it's not getting switched? The (not loaded) postfix tells me that the objects were unloaded, ie. the scene changed

candid patio
#

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

charred stump
#

Nah you didn't waste my time, you also learned how to do basic debugging