- Home /
Character Selection Scene Help
So I finally finished one part of my game and now I'm working on the character selection scene. I have some stuff on the scene- the characters, the camera, etc. But I would just like to know, what script is best for selecting my character? I want a script that when you click on a character a GUI button will appear and say something like "You have chosen the Human, click to play" then I click play and the game will start with the selected character as my player. Please help because scripting is not my thing.
Answer by dorpeleg · Mar 17, 2013 at 09:52 PM
Make an enum var with all your character "types".
Something like:
public enum character {
Human,
Elf,
Orc
}
Then, using ray casting, you can know which character was clicked.
Something like:
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit, Mathf.Infinity)) {
}
Well... this is a start, I Don't want to write down the entire code for you.
If I will, you will never learn :)
Your answer
Follow this Question
Related Questions
Can someone help me fix my Javascript for Flickering Light? 6 Answers
Setting Scroll View Width GUILayout 1 Answer
Play music trough scenes 0 Answers
Fonts not displaying properly when loaded through script 0 Answers
I can do this in JS or not ??? 2 Answers