private void Update() { if (rotate) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { rotatable.LookAt(hit.point); } } }
public void LookAt(Vector3 position) { rotatable.LookAt(position); }