- Home /
Attach audio source to different part of object
I have a semi truck as a game object. I want to attach a sound of the trailer rattling around to the back and the sound of the engine to the front. What is the easiest way of doing this.
I would imagine the easiest way of doing this is to attach audioSources to empty gameObjects. Then, make them child objects to the truck and position them where they sound the best and the most realistic.
I am uneducated about child objects, but I assume they follow what the parent object does. I'm skeptical about this because all of my semis are initiated clones, so i'm not sure if I would have to initiate the child object. If this works, could you direct me to a page about child objects, or just show me what I would do?
I agree with @fifthknotch. Yes, child objects follow parent. If your prefab has child objects, then on Instantiation your clones will too, nothing special needed. There's no magic behind parent/child, take something in your hierachy and drag it directly onto something else - tada, parent/child relationship.