animations are triggered via Animator through state variables which have string identifiers.
you can map these string identifiers inside scriptableobjects to correlate with certain actions, then make a function that takes these and triggers Animator accordingly.
Animator uses state diagrams to interconnect individual keyframe animations. these state diagrams are in their own separate files.
I’m certain someone has already made something similar to want you want, in some capacity.
What I mean is that I personally can’t help you more than just explaining the systems and how they work.
i think i get how the animator work in general.
rn if i just use the strings states it will make my diagram very big (i will have to insert all the animations and give each a state). at least this is how i undestand it.
i want to create the diagram in the scene, and insert the animations in separate at the start.
Another idea would be that you don’t store the animation directly into the ScriptableObject but their String name.
You could then store your animation in the resources folder and load them based on the name when you need them.
Let me suggest you get 100% familiar with the recommended way of doing animations and managing assets in Unity before you go inventing your own notion of how it should be done.
Do the simplest approach first, if it begins to have difficulty scaling up, refactor and implement a management layer to help you.
Making the management layer(s) in advance, especially before you are even versant in the basics of Unity asset management, is guaranteed to fail in spectacular time-wasting fashion.
But of course, it is your time to waste. I recommend starting by working your way through a MINIMUM OF THREE different tutorials on animation, all from different people, to get a feel for how things work.
You can check AnimationOverrideController.
you can have a single animator with some default animation clips like idle, walk ,run.
Then create AnimationOverrideController for each characters. drag and drop the original animator into this component’s controller for each character. now the fields open up for you to put your respective character’s idle ,walk and run animation clips into it.
Now you have AnimatonOverrideControllers for each character with their respective walk,run and idle clips.
in your code just use whichever animator you want .