AnimationSounds - Fast, Versatile, & Secure


AnimationSounds

Fast, versatile & secure animation sounds


How does it work?

The system constantly sweeps through all the rigs and their playing animation tracks, connecting to the tracks event, and cleaning up when the track isn’t playing anymore.


Download:

Roblox Model
Copyable Roblox Place (Recommended to look through) - An example implementation with some helpful utility modules that work nicely with this system


Features:

  • Fully client sided - no remotes are used
  • Versatile yet user friendly - can be easily used in any game
  • Fast - updates take a fraction of a ms
  • Secure - protection against exploiters spamming animations

API:

Module.AddRig(Animator: Animator, RigValue: any)
Adds an animator to the system. “Rig Value” can be anything

Module.RemoveRig(Animator: Animator)
Removes an animator from the system

Module.SetRigEnabled(Animator: Animator, Toggle: boolean)
Sets whether a rig will updated and will callback for sounds

Module.AddCallback(Callback: Callback): number
Adds a callback function to the system. The callback will be called when any rig reaches a sound marker for any animation. The callback should be used to actually play a sound. The function returns a number which acts as in ID for the callback

Module.RemoveCallback(Id: number)
Using an ID which is returned from AddCallback, you can remove the callback from the system


Adding sound markers to your animation:

  1. Add a new marker to your animation
    image

  2. The name should be “Sound” (unless you change it in the module’s settings), and the parameter can be whatever you’d like


Settings:
Settings can be found at the top of the module with explanations


Heat and Focusing, what is it?
Each rig has their own heat and focusing

  • “Heat” is a number that increments every time a sound marker is reached. It resets every SOUND_HEAT_STEP. If the heat surpasses SOUND_HEAT_MAXIMUM, it will “overheat”. When a rig is overheated, it wont callback for any sounds for SOUND_OVERHEAT_PUNISHMENT_DURATION.

  • “Focusing” is a table of animations. Only focused animations can callback for sounds. The max amount of focused animations is determined by MAXIMUM_FOCUSED_TRACKS_AT_ONCE. The minimum amount of time a track has to be focused for is determined by MINIMUM_FOCUS_TIME


Closing

This system will require a bit of setup! Although after you get it in your game and working, it’s very easy to work with. I don’t require any credit for this, but it would be appreciated if you’re feeling kind.

My Creations & Info


Footage

Update time for 50 rigs playing a footstep sound every 0.5 seconds when walking:
image

I’m using this system in my own personal game:


18 Likes

This is the only public module I will use in my entire life… Thank you.

2 Likes

It’d be nice if this could be generalized to animation events as a whole. Unless there’s a specific reason you didn’t, I don’t see why not

2 Likes

I hate profile service. Now you don’t have a doubt.

2 Likes

Okay but why are you arguing about what I do? Like what’s your problem? If you use those crappy libraries then okay, just don’t shove your damn opinion up my face.

Also, I make large scale games without using them. Because I can just make em myself.

2 Likes

You are. I stated one opinion on this post and you felt the need to reply that “nOoOooOo use 3rd part softwares!!1”

For me, they are. They are not of any use for me, nor will they ever be.

Yes you are, if you weren’t then you wouldn’t have kept arguing.

Why not? It’s clearly my choice if I want to hate or like something. You can’t force your ideology on me.

Roblox pre-made systems to the same. The only thing about these libraries are some extra features.

Because it gives me more control over everything and how stuff works. If I make something myself then i know the internal workings of it way better and have full control over it.

Im giving my opinion, i didnt straight up say use this, I have no power on what you use, and how you make your games, im sharing how it is helped me so you can understand the appeal of using them. If it sounds like im forcing you to use external modules then im sorry, as that is not my intention.

This is fair, i also like this type of control, it is why i always check out the source before i actually use it and see how it works, along with checking out docs if any and seeing if it is actually worth it

This could actually be done right now if you wanted, which is the beauty of it being so versatile. All it’s take is renaming the module and some variables so that it’d sound more generalized, but the functionality should already be able to work for mostly anything. I dont think ill be updating the module for this though, as it wasnt really my intent while creating this, and I personally don’t have a usecase for. But by all means you can change the module in anyway you’d like.

1 Like