• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. 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
583
Reactions
2,769
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