- Home /
Script to start another object
So iv been working on my main menu for obviously a game... and id like it if once you clicked on single player, it opens the game object of "New game" and "Load Game" 3d texts.. iv tried all i know and cant get it to work, Anyways here's my script i tried>>
var NewGame = GameObject;
var LoadGame = GameObject;
function OnMouseEnter() { renderer.material.color = Color.red; }
function OnMouseExit() { renderer.material.color = Color.white; }
function OnMouseUp() { NewGame.Enabled = true; LoadGame.Enabled = true; }
if you didnt notice it also does a color change on enter and exit...
what is single palyer is it an object or GUI. as you can see you have not assigned player Explain a bit more about your problem and what do want to do
For GameObject I think you use
NewGame.active = true;
Scribe
Answer by Michael CMS · Nov 04, 2012 at 10:36 AM
If your NewGame and LoadGame objects have children, you will want to use SetActiveRecursively(true) to get the desired effect.
At runtime (when you press the play button) do any gameobjects get enabled ? Or simply nothing happens ?
Answer by Casper091 · Nov 06, 2012 at 12:53 AM
thanks everyone, sorry im so use to c++ in school we use (Thing).enabled = true or false
Your answer
Follow this Question
Related Questions
Unity freezes when changing GUI.Color.a 1 Answer
Re Enable C# script on camera 1 Answer
Create GUI button in update function? 3 Answers
Texture Importer 3 Answers