Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Music & Sound FX / trigger/sound zone help

Author
Message
theshizer1210
11
Years of Service
User Offline
Joined: 3rd Oct 2012
Location:
Posted: 3rd Oct 2012 22:14
Okay so basically I just want to have a sound of this girl laughing when you enter the trigger zone or sound zone, but as soon as you exit the zone i don't want the zone to keep playing. How do i make this happen.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Oct 2012 22:42
It depends on how you are defining the zone. Let's assume 3D and say the zone is a box shaped area.

The dimensions are from the lower left corner to the upper right corner assuming +Z is forward. Let's say the box is 40 units on Z, 20 units on X and 10 units on Y. We'll say group A is the lower left, and Group B is the upper right:

A has coordinates (0,-5,10)
B has coordinates (20,5,50)

Now the zone is defined. We check if the character is within the trigger zone. Here's some pseudo code:



The code will check if the character is in the zone. If they are, the laughter will try and play while they are there. If the laughter is playing, it won't start again until the sound has played completely.

When they leave the area, the laughter will finish it's current sequence and stop.

Enjoy your day.
theshizer1210
11
Years of Service
User Offline
Joined: 3rd Oct 2012
Location:
Posted: 6th Oct 2012 01:06
Thank you. You helped me a ton

Login to post a reply

Server time is: 2024-04-20 15:13:49
Your offset time is: 2024-04-20 15:13:49