#Thread
1 messages Ā· Page 1 of 1 (latest)
I donāt think so
look in the Console.
then you will know for sure
i see the error, but let's check that first
Where is the console window
Ok found it! It said that de main object main camera is missing and the reference script on the behaviour is missing
that's a separate issue, I suspect
also, is there a reason you're using unity 2017..?
Yes cause my computer is old and I am still saving up to buy a good one
Yes
Show me the errors.
did you attach a "Scene Changer" to that object, then rename the class to "Scene Switcher"?
because that would certainly cause the problem
Ok
do the names match?
if so, you should be able to add the SceneSwitcher component.
Ok where could I find it?
do you not know where the Add Component button is?
no, that is not where you add a component
that is where you choose which component to target.
- add the SceneSwitcher to a game object
- drag that game object into the "on click" field
- choose the function from the dropdown
Ok but itās still giving me the same error that it canāt add the script to the game object
Then you either still have a compile error (an error that doesn't go away when you clear the console)
or you didn't name the class correctly
that's not a compile error
it's a problem, sure
it suggests that you have a missing component on the "Main Camera" object
if you look at the inspector after selecting it, do any components say "Missing"?
The render texture
Show me what it looks like.
That is not a problem.
"None" just means nothing is assigned
you only assign something there if you want to make the camera render to a texture, instead of the screen
i'm curious about that "Nothing Selected" component
ah, that's what Unity used to say instead of 'Missing'
lol
Bruhh
i briefly used unity about 8 years ago
but i don't remember a lot of the specifics, haha
Ok?? š„²
again, the RenderTexture thing is completely irrelevant
ignore it
i am talking about this component
that says "Nothing Selected"
the target texture has nothing to do with this
I added the scene switcher to that just now
But it said that the script has errors
Nvm maybe I should wait until I have a better computer cause this version isnāt working the way I was hoping it to
this could mean many things
show or describe to be me exactly what it said
This
you spelled the file name as "SceneSwicher"
is that exactly how you spelled the name of the class?
Where is the class š
you showed me a picture of it earlier
you declared a class class called SceneSwitcher
Ok
also, an important tip: if you rename a file, rename it in unity
that way, it understands that the new file is the same thing as the old file
otherwise, all of the components made from that script will break
Ok I will
now that the component is attached and working, drag the object it's on into the field on the button
and pick the function you want
Ok
Itās not switching scenes but Iāll get to that later
Thanks!
Itās still not showing up to the on click()
double click on the object here. does it take you to the object that you put the Scene Switcher component on?
It connects to the game object that I added the script to
show me the inspector for that target object
that is not the inspector
that is an object picker
i'm asking you to select the object you dragged into that field
This I the object
okay, so that looks reasonable
name the object something more distinctive
like "Switcher"
Ok just did
so, the button's target is now called "Switcher"?
Yes
do you see an entry in the function dropdown called "SceneSwitcher"?
so you can select the function?
Yes
that's what I thought you meant here
Thatās what I meant yea
you had nothing selected here
I changed it cause it finally showed up
Nothing happens when I click the button exept that it shows itās button
so nothing appears in the console at all?
exept that it shows itās button
what do you mean?
I can click the button but nothing happens like it doesn't switch to another scene
Did you add it to the list in the Build Settings menu?
Yes I did