Pan script setting


(Bartosz) #1

Hello,

I’m trying to make a script with slider to set pan of played event. -1 would be left, 0 center and 1 right. What should I do with choosen by me event in CreateInstance to set pan?
Is there possibility of setting pan to left or right in case of 2D event?

Regards
Crane


(リチャード清水) #2

Hi Crane,

I’m going to assume you are referring to panning a 2D event in your game through game code. The easiest way to do this is to ensure your event’s master track output is at least stereo, and add automation to the panner. Use a game parameter to automate panning left (-1) to right (1). You can then use ParameterInstance::setValue to pan the event instance.

https://www.fmod.com/resources/documentation-api?page=content/generated/FMOD_Studio_ParameterInstance_SetValue.html#/

Let me know if you need any further help.

Thanks,
Richard


(Bartosz) #3

Your answer gave me a lot. Thanks for help !