I have to automatically rotate my character every fram according to position he’s at using Quaternion.LookAt(). But at the same time I want to be able to rotate him around Z axis, which of course I can’t since that value is denied by the LookAt() function. Of course, I can solve that problem using math but maybe there’s a simpler way. I tried this
Vector3 direction = planet.transform.position - body.transform.position;
direction = new Vector3(direction.x, direction.y, this.transform.rotation.z);
transform.rotation = Quaternion.LookRotation(-direction);