0 votes
asked in AimIK by
Hey, great asset!

I've got an issue surrounding Instantiating a character clone utilising AimIK. When the character spawns AimIK is enabled but only partially resolving. I can disable/enable the component in the inspector which fixes it. I've tried doing this in the Start() method but no such luck.

The reason for the cloning is because I'm utilising the new Unity InputSystem split screen feature which spawns clones of whatever prefab is provided.

Any help on this would be great!

Thanks,

Adam

1 Answer

0 votes
answered by (22.8k points)

Hey,

Weird, haven't seen anything like that before, AimIK doesn't really do anything special when you disable-enable it in Editor. Can't think of anything. What did you mean exactly by "partially resolving", like it had half weight?

Could try removing AimIK from the prefab and adding it by script in Start:

ik = gameObject.AddComponent<AimIK>();

ik.solver.SetChain(new Transform[2] {animator.GetBoneTransform(HumanBodyBones.Spine), animator.GetBoneTransform(HumanBodyBones.Chest))}, transform);

ik.solver.transform = animator.GetBoneTransform(HumanBodyBones.RightHand); // This is the Aim Transform

ik.solver.axis = rightHandForwardAxis;

Welcome to RootMotion Q&A, where you can ask questions and receive answers from the developer of Final IK and PuppetMaster and other members of the community.

Post as a guest, create an account or login via Facebook.

Please use the correct category when you post your questions.

...