- Home /
Can you set a component (audio source) position manually
I'm trying to add audio components to various game objects but the component is not being centred on the object itself? All of the game objects consist of parent/child objects with the audio source being on the parent. In some cases the audio source is being placed 3-4 units away from object its supposed to be attached to?
Any ideas how I can remedy this ???
I have this exact same problem. It appears that even though the parent object which the AudioSource is attached to is properly zeroed (XYZ 0,0,0), a few of the children and grandchildren have funky offsets, and the AudioSource is somehow averaging the offsets of the combined entity, resulting in an AS that is 2m back and 4m right of the object origin. :( Obviously, rebuilding works, but I too would prefer a manual shortcut to reposition the AS much as one can manually adjust positioning on a Box Collider.
Answer by Digital-Phantom · Jan 05, 2015 at 02:21 PM
Anybody?
Not the biggest hardship but may just rebuild my gameObjects to make sure they are all centred. Would still be nice though to figure out why things are being added at an offset ?
:/
Answer by isbjorn · Feb 17, 2017 at 06:11 PM
As outlined in comments in this thread a solution can be to first assign a child object:
Right click (on Game Object) -> 3D object -> Cube
Make it invisible (by de-selecting Mesh Renderer) and position it freely with respect to its parent. Attach your audio source to the child:
Right click (on Cube) -> Audio -> Audio Source
Your answer
Follow this Question
Related Questions
Detecting the rotation of the current object? Shield resets when undertaking orbit. 2 Answers
Vector2.magnitude and Touch.deltaPosition understanding.... 2 Answers
Updating localPosition(?) in a scaled transform parent 1 Answer
How to change game object's parent in hierarchy without changing it's transform's position? 1 Answer