- Home /
Sound help with script
Hi ... Need help with a sound script before all expicarles: I have a script that goes in the FPC which makes it possible to push an object with Rigidbody, now that only pushes and makes no sound of "drag" I would like to help me in a script that when the object is pushed (or rather that when a object either transform.position in my case "z" change) play a sound, and when you stop pushing (z stop changing or move) the sound stops reproducirse.
Please if anyone can help me with that or provide me a script best objects push really appreciate it, not much programming, something maybe, but not where ampezar with this. u.u
Answer by sang · Sep 19, 2013 at 06:53 PM
You will need to add an AudioSource to the object being dragged and drag a sound clip file to it. When you push it, call draggedObj.audio.Play();
yes it is, but, I know how to call the script when pushed and when you stop pushing, it's the only thing I'm missing, or rather, when the object moves in z and play a sound when stop to move the sound stop
Oh, in that case, you should set the audiosource to loop, then by script change the value of audio.mute.