Chain IK not working

I’m trying to hit the ball with bat, so I’m using chain ik,


Screenshot 2024-08-16 123734
but it’s not working. I have 2 chain ik one for left hand and one for right hand. Right-hand chain ik is working cause I have added all the fields in the prefab and left-hand ik is not working cause I’m setting the target of left hand at runtime. Check this image. I also tried creating the left hand chain ik at runtime but it’s not working too

Do you mean the Target (Transform) you set after running? The Transform should be set in the Editor. Modify the position and rotation at Runtime.

can i set the target at runtime?
I found a solution but it’s weird

You don’t need to set the target(Transform) at runtime. You just need to bind a target Transform in Editor (as a placeholder) and then, at runtime, assign its position/rotation to match the position/rotation of your actual target.