My guess is that you are trying to get an angle from a vector to a point. Vector3.zero is not a directional vector, so everything is perpendicular to it (90 degrees).
Try using Vector3.forward instead, but you’ll run into another issue. When there is no input (essentially the same as Vector3.zero), you’ll turn up a 90 degree output (because every vector with magnitude, wich Vector3.forward has, will be perpendicular to that point). Just do a test to see if there is any input. If not, no need for any rotation anyway. If there is, Vector3.forward should do the trick.
From the code, it’s not quite clear whether you want to point the character to track a target object or if you want to rotate and elevate your object (like aiming a gun or telescope on a mount).
Pointing at a target transform is easily done with the Quaternion.LookRotation function (the doc page actually has an example of pointing your object at a target).
If you want to rotate and elevate your object based on keyboard input then the technique I would recommend is to put your object inside a parent object. Achieve the rotation by turning the parent around its Y axis, and elevate by turning the child around its X axis (you can turn an object around an axis using Quaternion.Euler or Quaternion.AngleAxis.
If I’ve completely misunderstood your intention and neither of these techniques helps, then please post again.
Sorry, I should have been more specific… it’s for a game where up/down/left/right controls a character from a top-down viewpoint in which direction they should go.
In any case the Quaternion thing was exactly what I needed. I’ve been avoiding Quaternions due to completely not understanding them, and thus didn’t think to look there. Thank you!