is there a way in Unity to access the Motion clip of an Animator State and change it at runtime via script? I am trying to do a character shop in my 2D game. My idea is, when i click a GUI button it would just select different motion clips but the states would stay the same. It's just a simple Jump and Idle state, parameters dont change. I just want to feed in different animation clips for different characters.
Yes, but you would do this via the Mechanim state machine. Create a transition and set it to change via a Trigger.
Doing it this way, when you want to swap animation states, you simply do this:
If you want to set the Animator Motion directly, it is a little more complicated. You will need to create Animation Controllers, and then swap them using the AnimatorOverrideController.