in the old unity i learned from a tutorial how to make a script to do that but now in unit 5 it doesn’t work. can someone help me with changing the code so that it works. on this link is the tutorial youtube link
and this is the code line in java
hope someone can help me
greetings danny
var levelToLoad : int;
var soundhover : AudioClip;
var beep : AudioClip;
var QuitButton=false;
function OnMouseEnter(){
GetComponent.<AudioSource>().PlayOneShot(soundhover);
}
function OnMouseUp(){
GetComponent.<AudioSource>().PlayOneShot(beep);
yield new WaitForSeconds(0.35);
if(QuitButton){
Application.Quit();
}
else{
Application.LoadLevel(levelToLoad);
}
}
@script RequireComponent(AudioSource)
Are you sure there is a collider on the object ? It's necessary if you want OnMouseUp to be called.
– Helliumi did and the only thing that change is the shadow on the object that's clickt . maybe you can try to make a scene yourself if you have time ?
– travelplays_the_world