Question by
FernandoWilliam · Sep 13, 2015 at 09:02 PM ·
unity 5javascriptscript error
Helppp mee script unity 5
convert to unity 5
var quit=false;
function OnMouseEnter()
{
renderer.material.color = Color.red; //Change Color to red!
}
function OnMouseExit()
{
renderer.material.color = Color.white; //Change Color to white!
}
function OnMouseUp()
{
if (quit == true)
{
Application.Quit(); //If you click on quit aplication quits.
}
else
{
Application.LoadLevel(1); //If you click on other button it loads game!
}
}
function Update()
{
if (Input.GetKey(KeyCode.Escape)) //If you press (escape) game force closes!
{
Application.Quit();
}
}
Comment
Answer by Positive7 · Sep 13, 2015 at 10:02 PM
change renderer
to GetComponent.<Renderer>()
It should be Unity upgrade-able by Default
Your answer
Follow this Question
Related Questions
What's wrong with my script? 2 Answers
Need a Script for Changing Scenes after pressing E to open locked door once a key has been found. 0 Answers
Unknown Identifier : Hunger? 1 Answer
Triggering Image Effects in Unity 5 0 Answers
JavaScript to C# 1 Answer