Add animatins to Animator through code?

Hello friends!
I hope that this question is not already answered, if so, feel free to give me the link and this thread can be closed.
However i could not find any information regarding this problem that i have encountered.
I am making a 2d game with several different characters. The amount of characters is quite large so therefore i want to use the same preafb for them all.
I have discovered that its possible to add a animator from resources on start/awake, but the animator is also quite demanding to setup so what i would like is ann effective way to add animations to my animator through code, is this posible?

Thanks in advance!

Out of my research it seems that this is not possible, but feel free to share your knowledge if im wrong!
Thx!

You could check out the Playable API for more dynamic animator usage.

1 Like

Thank you!
This looks promising! And as long as im not migrating to a newer version it should be ok to use experimental i suppose.

1 Like

Update:
I did not find this playable api usefull for my needs, however it might suit me later on.
I found the overrideController for the animator, this was’nt entirely what i sought for, but it simplifies the setup of the animator a great deal! And by doing like this i dont have to worry about changing something in a animator without knowing.

Thx for the reply anyway, cheers!

1 Like