public override UnitState FixedUpdate() { var globalLookDirection = Parameters.LookLogicDirection; var moveScaledLogicDirection = Parameters.MoveScaledLogicDirection; var parametersAngle = AngleCalculator.CalculateLogicAngle(moveScaledLogicDirection, globalLookDirection); var logicLookDirection = GetLogicVector(globalLookDirection); if (Mathf.Abs(parametersAngle) <= 120) { ManageReachingLegsTurnDirection(logicLookDirection, moveScaledLogicDirection.normalized); } else { ManageReachingLegsTurnDirection(logicLookDirection, -moveScaledLogicDirection.normalized); } Torso.TurnTowards(logicLookDirection); Torso.AimAt(Parameters.AimAtDirection); Legs.Move(moveScaledLogicDirection); Legs.StraightenUp(); Torso.Move(moveScaledLogicDirection); Torso.StraightenUp(); return this; }
public override UnitState FixedUpdate() { Torso.TurnTowards(Parameters.LookLogicDirection); //Torso.StraightenUp(Mathf.Abs(Vector3.Dot(Torso.transform.up, Vector3.up) * 0.4f)); //Legs.(Mathf.Abs(Vector3.Dot(Legs.transform.up, Vector3.up) * 0.2f)); return(this); }
public override UnitState FixedUpdate() { var logicLookDirection = GetLogicVector(Parameters.LookLogicDirection); Torso.TurnTowards(logicLookDirection); Torso.AimAt(Parameters.AimAtDirection); ManageReachingLegsTurnDirection(logicLookDirection, logicLookDirection); Legs.StraightenUp(); Torso.StraightenUp(); return(this); }