void LateUpdate() { if (Time.timeScale != 0) { if (!GetComponentInParent <Movement_Handler> ().isAlive) { this.enabled = false; } if (Target != null) { x += (float)(Input.GetAxis("Mouse X") * xSpeed * 0.02f); y -= (float)(Input.GetAxis("Mouse Y") * ySpeed * 0.02f); if (y > yMaxLimit) { y = yMaxLimit; } else if (y < yMinLimit) { y = yMinLimit; } movHdlr.rotate(Input.GetAxis("Mouse X") * xSpeed * 0.02f); transform.localPosition = new Vector3(0, y, -Distance); transform.LookAt(Target); } Aim(); } }
void Update() { if (movHdlr.isAlive) { float rotation = Input.GetAxis("Mouse X") * sensitivityX; //transform.Rotate(0, rotation, 0); movHdlr.rotate(rotation); } }
public void Setup(float speed, float angle) { float angularSpeed = angle * angleResponseTime; bool run = speed > 1 ? true : false; mov.VerticalMovements(speed, run); mov.rotate(angularSpeed); }