// Move this actor towards the target void Move() { if (target.transform.position.x >= (transform.position.x - positionalDiffTolerance) && target.transform.position.x <= (transform.position.x + positionalDiffTolerance)) { movementController.SetMove(0); } else if (target.transform.position.x > transform.position.x) { movementController.SetMove(1); } else if (target.transform.position.x < transform.position.x) { movementController.SetMove(-1); } StartCoroutine(ChooseAction()); }
// Catch input for horizontal movement public void MoveInput() { playerMovementController.SetMove(Input.GetAxis("Horizontal")); if (Input.GetAxis("Vertical") < 0) { playerMovementController.SetIgnoringPlatforms(true); } else { playerMovementController.SetIgnoringPlatforms(false); } }