Is there a way to add a state the CharacterIk script after it's created?

adampliska

New member
Hi there,

I am using UMA, I have been using the plugin provided for UCC. I have the system working pretty well with a dynamic UMA being created fully at runtime. However, I am not able to add a state to the CharacterIk script.

The states for that script seem to be initialized during the Awake call. It seems that once a script is initialized though the state system it cannot be initialized again. I have no time between Awake is called and the state system is Initialized, and I can't see how to add a new state after initialization with the state system. (I have added one, it doesn't work - the state will never activate)

Is the only way to do this to subclass the CharacterIk class, add the state in the Awake override, and call base.Awake? I'll give that a try but it will require adding the IK manually though the UMACharacterBuilder integration. Is there another better way to add a state _after_ initialized is called?
 
I got this working, and it did not require me to subclass the CharacterIK component. Quite simply, I just needed to set the root game object holding the component to inactive, then add the states programmaticly, then reactivate the root game object! easy!
 
Top