This content has been marked as final. Show 5 replies
I your are asking for a behavior (drag and drop) i dont know one.
But with a little lingo you can achieve the desired effec:
Create a sound channel (with lingo), and asign it a sound cast member.
Get the distance between the car and the target object (use worldposition property of the model). get the magnitude of the vector (a integer)
Define a function that receives the distance (zero to infinite) and return the volume (0 - 255 or 255 - 0).
Change the volume of the sound channel.
You have to do this periodic, it can be in an enterframe handler or you can use a timeout object. that calls the method, for example, every 500 ms (i would do it in the enterframe after update the car's position)
I am new to this. Can i know how can i get the magnitude of the vector since it was created in 3D studio max? I was stuggling at this section. Also, can i get some example script as you mentioned in the above "Define a function that receives the distance (zero to infinite)" since i don't know one.
Thank you so much for the help.
That post is a good outline of a simple "3d sound manager"... but creating a re-usable and rigorous script to setup and change sound volumes and panning takes work (for example I've made one and it's about 1000 lines of code). Until there is some automatic sound handling via lingo, this is how you have to do it.
But here is some example that may help:
I will try the script soon and tell you the results ok. I hope it will works well.