Currently the attenuationObject
in StudioListener
is private and can only be set in the inspector, but there does not seem to be any technical reason for this limitation. The listener is updated from the attenuationObject
every frame so any other changes to it work correctly.
Hi,
Thank you for bringing this to our attention!
To better understand your needs and how this feature could improve your workflow, could you please elaborate on your desired usage? Specifically:
- How would dynamically setting the
attenuationObject
benefit your project? - Are there specific scenarios where runtime changes are essential for your implementation?
We’d love to hear more about your use case so we can assess how this might align with future updates.
I would like this too. When I’m working on a game with multiple listeners and attenuation objects or just shifts in perspective it can be handy to set the attenuation object on the fly.
As a workaround I just open up StudioListener.cs and add this:
public void SetAttenuationObject(GameObject someObject)
{
attenuationObject = someObject;
}
It’s a small inconvenience, but I don’t see why it shouldn’t be exposed.
Locally I just make it public but I don’t like having changes in third-party code, and it makes upgrading more difficult.
Our game has a third person player, however the camera rig is dynamically created and attached to the player where I need to assign the attenuation object. Also the player can activate a drone that the camera rig attaches to and the attenuation object switches to the drone (and back again).