• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.

Question I want to play a sound from a script.

Feel

Well-known member
Featured Contributor
Joined
Aug 18, 2022
Messages
586
Reactions
2,783
There is a vam default sound.
I'd like to have this play from a script.



JSONStorableActionAudioClip audioclip = atom.GetStorableByID("HeadAudioSource").GetAudioClipAction("PlayNow");
audioclip.actionCallback = (NamedAudioClip nac) =>
{
SuperController.LogMessage(">> " + nac.displayName);
SuperController.LogMessage(">> " + nac.sourceClip.name);
SuperController.LogMessage(">> " + nac.category);
};

I got to this point.
Afterwards, I don't know how to access the built-in sound.
And I don't even know how to play Audio.

Could you please let me know?
 
Back
Top Bottom