public void advanced() { Mathf.Clamp01(compensateYaw); Mathf.Clamp01(dampenYawCompensation); if (cam != null) { Vector3 eul = new Vector3(); eul.x = Mathf.Lerp(eul.x, -compensateYaw * BenjasMath.keepAngleBetween(transform.localEulerAngles.x, -180, 180), dampenYawCompensation); cam.transform.localEulerAngles = eul; } }
public void setBacon(float Angle) { Vector3 pos = baconOne.anchoredPosition3D; angleBacon = BenjasMath.keepAngleBetween(Angle, -180, 180); xposBacon = BenjasMath.map(angleBacon, -clampBaconAngleAt, clampBaconAngleAt, -clampBaconAt, clampBaconAt, true); //center around 0 degrees pos.x = xposBacon; baconOne.anchoredPosition3D = pos; }