/* This function performs a call to the IKSolvers CCD algorithm, which then solves this chain to the current target. */ private void solve() { if (ikSolveMethod == IKSolveMethod.CCD) { IKSolver.solveChainCCD(ref joints, endEffector, currentTarget, getTolerance(), getMinimumChangePerIterationOfSolving(), getSingularityRadius(), adjustLastJointToNormal, printDebugLogs); } else if (ikSolveMethod == IKSolveMethod.CCDFrameByFrame) { StartCoroutine(IKSolver.solveChainCCDFrameByFrame(joints, endEffector, currentTarget, getTolerance(), getMinimumChangePerIterationOfSolving(), getSingularityRadius(), adjustLastJointToNormal, printDebugLogs)); deactivateSolving = true; //Important here is that the coroutine has to update the error after it is done. Not implemented here yet! } error = Vector3.Distance(endEffector.position, currentTarget.position); }