# PlayOneShotAttached with relative offset

**URL:** <https://qa.fmod.com/t/playoneshotattached-with-relative-offset/24259>\
**Category:** Unity\
**Tags:** unity, csharp\
**Created:** [May 13, 2026, 7:02pm UTC](https://qa.fmod.com/t/playoneshotattached-with-relative-offset/24259 "2026-05-13T19:02:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AranyhalStudio](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@AranyhalStudio](https://qa.fmod.com/u/AranyhalStudio)\
**Post date:** [May 13, 2026, 7:02pm UTC](https://qa.fmod.com/t/playoneshotattached-with-relative-offset/24259/1 "2026-05-13T19:02:49Z")

</div>

Is there or will there be a way to play a oneshot that is attached to a GameObject with a relative offset?

For example, this way I wouldn’t have to create new GameObjects just to make a bullet hit sound. (I know normally you could use PlayOneShot, but my entire scene is moving, so the sound would get left behind)

I imagined it working like PlayOneShotAttached(EventReference reference, GameObject parent, Vector3 LocalOffset).

---

<div class="post-metadata">

**Author:** ![EdGray](https://avatars.discourse-cdn.com/v4/letter/e/bbe5ce/32.png) [@EdGray](https://qa.fmod.com/u/EdGray)\
**Post date:** [May 13, 2026, 7:38pm UTC](https://qa.fmod.com/t/playoneshotattached-with-relative-offset/24259/2 "2026-05-13T19:38:36Z")

</div>

Can’t you just put that relative offset into the transform of a child gameobject and then attach the sound to that? Or does the offset need to vary?

---

<div class="post-metadata">

**Author:** ![AranyhalStudio](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@AranyhalStudio](https://qa.fmod.com/u/AranyhalStudio)\
**Post date:** [May 14, 2026, 6:42am UTC](https://qa.fmod.com/t/playoneshotattached-with-relative-offset/24259/3 "2026-05-14T06:42:06Z")

</div>

Yeah it needs to vary, so I would need to create a lot of childs which is bad for perf

---

<div class="post-metadata">

**Author:** ![EdGray](https://avatars.discourse-cdn.com/v4/letter/e/bbe5ce/32.png) [@EdGray](https://qa.fmod.com/u/EdGray)\
**Post date:** [May 14, 2026, 7:53am UTC](https://qa.fmod.com/t/playoneshotattached-with-relative-offset/24259/4 "2026-05-14T07:53:43Z")

</div>

Hmm well I think the standard practice with things like this is to not create a new gameobject each time (which, as you say, isn’t performant) but rather to instantiate a pool of these gameobjects ahead of time (the size of the pool would be the maximum amount of simultaneous shots you think can happen + a few more), then with each shot you’d set the offset of a gameobject in the pool, attach the sound to that, then increment your pool index and repeat.

I think that solution would probably be a lot quicker and easier than trying to add an extra overload to the PlayOneShotAttached method

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [May 18, 2026, 5:49am UTC](https://qa.fmod.com/t/playoneshotattached-with-relative-offset/24259/5 "2026-05-18T05:49:50Z")

</div>

Since you’re handling event instance playback using `RuntimeManager.PlayOneShotAttached()`, I agree with @EdGray that pooling a number of relative offset objects is a lot easier than trying to modify `RuntimeManager` and create a new overload. The other alternative is to handle event instance playback and 3D attribute updating in your own script instead of using `RuntimeManager`, which would give you a lot more freedom as to how you provide the 3D attributes of each instance. For example, you could store each relative offset as just a Vector3, and combine it with the root object’s coordinates when you pass the 3D attribures to FMOD.
