So, I am creating a turret. I basically used transform.LookAt for it to look at the target (it’s a sphere right now). But I want it to not go up or down the Y axis. How do I do that?
For every axis you want it to ignore, set the variable for the position to the position of the item looking.
For example, if you wanted it to only look up and down, you’d do this: transform.LookAt(Vector3(transform.position.x, otherObject.position.y, transform.position.z));