Hello. I have a question about script code.
First of all, what I’m going to do is take a 3D drone model, put a person at the starting point, and as the drone moves away from the person, I’m going to lower the volume.
(Note, I know how to adjust the volume.)
So I think we should figure out how many meters away people and drones are, and adjust the sound according to the interval.
For example, if a drone is very far from a person, I will make a sound of 1, and if it is very far, I will make a sound of 0.01.
(Use the map function used in c language to form a sentence like “val=map (val, 0, 100, 1, 0.01)”. But in Java,
The map function had a different meaning from the c language. I wonder what function Java should use.)
I also want to know how you can figure out the distance between an object and an object.
I’m going to look at the index on the site one by one and make code.
Please help me write the code.
(Sorry for the long text…)
If the way I’m trying to do it is foolish, please give me another good idea.
You may not understand the language using the translator…I’m sorry.
Please give me an answer. Thank you!