How to freeze one axis when looking toward position

Hi! i’m kinda new in incripting, i was wondering how to achieve the effect of a plane looking always to the main camera position, but not changing it’s local y rotation(it’s not exactly that but it’s the idea), i want it to looks like a classic fps sprite, LookAt() won’t work, so far i set rotation of my plane inverse as main camera, it always looks as a flat gui but in 3d space, intersecting with wall and stuff, the plain is inside an empty transform to solve minor problems, etc…I made this

function Update(){
	transform.rotation=Camera.main.transform.rotation;
}

Now i need to freeze some thing like “local axis y”. Thanks! :smile:

HAHAHA! sorry for that, i solved it, if someone wants to know…

function Update(){
	transform.rotation=Camera.main.transform.rotation;
}

function LateUpdate(){
	transform.rotation.eulerAngles.x=0;
	transform.rotation.eulerAngles.z=0;
}