Esempio n. 1
0
    private void Update()
    {
        gotoDirCenterPosition = sphereGoal.position;
        goal             = gotoDirCenterPosition;
        distanceToTarget = Vector3.Distance(goal, alphaOrigin.transform.position);
        zOffset          = (alphaOrigin.transform.position.y - goal.y);
        goal.x           = -gotoDirCenterPosition.z;
        goal.y           = -gotoDirCenterPosition.x;
        goal.z           = gotoDirCenterPosition.y;
        Vector3 angles = processIK();

        gamma.goToInstant(new Vector3(0, angles.x, 0));
        alpha.goToInstant(new Vector3(0, 0, angles.y));
        beta.goToInstant(new Vector3(0, 0, angles.z));
    }