Character IK reset?

Vlaxep

Active member
Hi,

In trying to run two separate character rigs on my player prefab, I'm needing to switch between 2 CharacterAvatars in the 'Animator' component. (This is to facilitate Skins that go on differing skeletons)

This pretty much works by switching what is required on/off and changing to the appropriate Avatar in the animator BUUUT the character then has heavy droopy arms and head.

The arms seem to get stuck down and character can't use weapons or aim anymore, but can run around normal from what it seems. The head is also 'heavy' too.

I'm guessing this is related to character IK but the values don't seem to have been changed.

I know I'm messing with stuff in an abnormal way but is there something I can do to reset everything to normal when I perform the Animator Avatar change?
 
Last edited:
I should clarify/add that on first initialisation the character works great, then switching at runtime to alternate Avatar and SkinMeshRenderer the heavy arms occurs.

If I switch back to the first root/skin/avatar again the heavy arms and head remains still.

In CharacterIK the only thing that makes a noticeable difference is bringing some values to around 0, (hand weight IIRC) but it's not great still. That's why I'm wondering whether there some easy to reinitialise the character somehow to original values of perhaps there's something else causing this?
 
(also I should mention the reason for this setup is due to needing multiple skin options from Synty characters packs that use different rigs that can't be merged. Combined with using for Pun 2 add-on and trying to avoid the nightmare of each player/actor needing multiple character objects)
 
For this kind of use case, I always just recommend people look into Unity's prefab variants, i.e. to have a base character prefab that you use for modifying all the usual UCC stuff like abilities and items, then variants of that prefab for different models, rigs, etc.

If that's really not a viable solution for your case, you may have to look into the CharacterIK script more closely. E.g. you may be able to manually call the InitializeBones method during runtime. However I'd be very careful with modifying any of it directly (especially private methods, which are private for a reason), since UCC is not really designed to be able to dynamically switch rigs during runtime.
 
For this kind of use case, I always just recommend people look into Unity's prefab variants, i.e. to have a base character prefab that you use for modifying all the usual UCC stuff like abilities and items, then variants of that prefab for different models, rigs, etc.

If that's really not a viable solution for your case, you may have to look into the CharacterIK script more closely. E.g. you may be able to manually call the InitializeBones method during runtime. However I'd be very careful with modifying any of it directly (especially private methods, which are private for a reason), since UCC is not really designed to be able to dynamically switch rigs during runtime.
Great thanks @Andrew , yeah I guess that would be my absolute last point of call. I know nothing about CharacterIK so if that doesn't work I'll simply have to work with the 2 character prefabs. In Single player it's perfect, but absolute Nightmare in PUN2 to allow players to switch cahracters.

I've actually successfully achieved it with PUN but am rebuilding it all as it became extremely complicated, and I need to simplify. Will try InitiliseBones though cheers!
 
Top