Locking rotation to axis

Hey, I’m having lots of trouble with a seemingly simple problem.
I’m using LookAt() method then setting the axes I don’t want to move back to 0 with:

aim.rotation= Quaternion.Euler(new Vector3(0,aim.rotation.y,0));

However, the value of aim.rotation.y changes when I do this and I can’t figure out why or how to get around it.

Also, I’m not quite certain how I should be using the LookAt method. I have imported my model from blender so it is currently on z-up local co-ordinates, should I be passing in a different world up vector?

In a different case I managed to get a similar thing working, but I don’t understand why it worked. I was currently trying to get something to pan, so I wanted only its y rotation to change, so to do this (after previous method didn’t work) I did this:

aimP.LookAt(new Vector3(target.position.x,aimP.y,target.position.z));

That would make sense to me, since it would be aiming at something at its own height (which was about 0.3 btw) and as such it would not have to tilt to face it. However this didn’t work and it was only when I passed in an arbitrary number (90) that it worked. I tested it with some other numbers and it seemed to tilt up and up from 0 to about 13, where it locked and was straight how I wanted it.

So yeah, I’m very confused about all of this and I hope someone can help me out. Thanks.
Working with c# btw.

I have imported my model from blender so it is currently on z-up local co-ordinates, should I be passing in a different world up vector?:

The z axis should not be facing Up. In unity3D Z is out, and Y is up. The lookat() function will not supply you with an antiquate rotation due to this. lookat rotates an object so its Z is forward towards the target.

I have been messing with this recently and what I did was a bit different because the LookAt() function just snaps your character to aim at the location inside of the function. This is a nice tutorial for what you want. It goes over rotations and also how to rotate smoothly if that is something you want and its even in c#.
Basically what Nicholas Costello said is right, in blender Z is the up and down vector but in unity Y is the up and down vector. And you want to set the transform.rotation = Vector3(position of thing you want to look at) then set transform.rotation.x = 0 and transform.rotation.z = 0 of whatever it is that you are rotating.