How do I make a credits button?
I want to have a credits button on my main menu that takes you on a click from my main menu scene to my credits scene. What is the code for that?
I need the code in C#.
Create a new Scene nam it "Credits" or "whatever" you want
Fill it with Contents
Save
Attach above code to your UI Button
"void" gives a parsing error and I can't find any functions under Load_Credits in the Load_Credits component.
This works perfectly here:
using UnityEngine;
public class test2 : $$anonymous$$onoBehaviour {
public void CreditsScene() {
Application.LoadLevel("Credits");
}
}
What error you have?
Assets/_Scripts/Load_Credits.cs(3,1): error CS1041: Identifier expected: `public' is a keyword
Answer by Positive7 · Dec 24, 2015 at 09:59 AM
It depends what you using for displaying your menu (UI, GUI, etc...) ?
Application.LoadLevel("Credits");
UI :
using UnityEngine;
public class Load_Credits : MonoBehaviour {
public void CreditsScene() {
Application.LoadLevel(2);
}
}
Your answer
Follow this Question
Related Questions
How To pass from level to the next after winning, with one button ? 1 Answer
Text adventure game, how to change text in a specific way with C# 1 Answer
Exposing a function to the inspector 3 Answers
Setting instance parent delays scene view update 0 Answers
Missing function in button on click 0 Answers