I am working on a tile-based game and need to know how to rotate the playable character to always face the tile that it is moving towards. I managed to use rotateTowards like described here, but it rotates my character on all three Axes making his head go through the ground and his feet float.

If somebody could tell me how to keep the rotation only in the y-Axis or could help me with any other solution for the problem I would really appreciate it.

Thank you very much!

You can take your Quaternion rotation and set the euler angles manually:

Quaternion myLookTowardsRotation;
myLookTowardsRotation = Quaternion.Euler(0.0f, myLookTowardsRotation.eulerAngles.y, 0.0f);