public void Move(Vector3 direction, float rotation) { if (!isDefending) { if (direction != Vector3.zero) { //this.transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(direction), 20f * Time.deltaTime); this.transform.eulerAngles = new Vector3(0f, -rotation, 0f); rBody.MovePosition(transform.position + transform.forward * speed * Time.deltaTime); } #region rotation variants //this.transform.Translate(direction * speed * Time.deltaTime); //position.rotation= Quaternion.LookRotation(coords); //Quaternion.RotateTowards(position.rotation, Quaternion.LookRotation(direction), Time.deltaTime * 30f); //this.transform.rotation = Quaternion.LookRotation(direction); #endregion actionPanel.ToogleButtons(false); playerAnim.SetInteger("Speed", 1); } }