public void Update() { if (playerController != null) { if (playerController.AttackButtonDown) { skills.AttackDown(); } if (playerController.AttackButtonUp) { skills.AttackUp(); } if (playerController.AltAttackButtonDown) { skills.AltAttackDown(); } if (playerController.AltAttackButtonUp) { skills.AltAttackUp(); } if (playerController.SkillOneButtonDown) { skills.SkillOneDown(); } if (playerController.SkillOneButtonUp) { skills.SkillOneUp(); } if (playerController.SkillTwoButtonDown) { skills.SkillTwoDown(); } if (playerController.SkillTwoButtonUp) { skills.SkillTwoUp(); } if (playerController.SkillThreeButtonDown) { skills.SkillThreeDown(); } if (playerController.SkillThreeButtonUp) { skills.SkillThreeUp(); } if (playerController.SkillFourButtonDown) { skills.SkillFourDown(); } if (playerController.SkillFourButtonUp) { skills.SkillFourUp(); } } Vector3 viewPos = Camera.main.WorldToViewportPoint(transform.position); viewPos.x = Mathf.Clamp01(viewPos.x); viewPos.y = Mathf.Clamp(viewPos.y, 0, .9f); Vector3 pos = Camera.main.ViewportToWorldPoint(viewPos); pos.y = 0; transform.position = pos; }