Quantcast
Channel: Questions in topic: "javascripting"
Viewing all articles
Browse latest Browse all 105

Adding sound to a script trigger

$
0
0
Hello, I got small Jump scare script that I would like to add sound to it and destroy it after one trigger. I added the variable but i just can't figure out how to get it to work. I would appreciate any help given. :) Below is the javascript. #pragma strict var Triger_Object : GameObject; var Triger_Sound : AudioClip; function Start () { Triger_Object.SetActive(false); } function OnTriggerEnter () { Triger_Object.SetActive (true); } function OnTriggerExit () { Triger_Object.SetActive(false); }

Viewing all articles
Browse latest Browse all 105

Trending Articles