Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How do I play a sound after the mouse goes through an object?

$
0
0
I'm doing a menu for my game and I don't know how to play a sound after the mouse pass through it... I just made it change the color and load the next level. for example. using UnityEngine; using System.Collections; public class play : MonoBehaviour { public bool sair = false; void OnMouseEnter () { renderer.material.color = Color.blue; } void OnMouseExit () { renderer.material.color = Color.white; } void OnMouseDown () { if (sair) { Application.Quit(); } else { Application.LoadLevel(1); } } } ***

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>