I've been using the following code to constrain LookAt to a specific axis:
Vector3 lookAtPos = target;
lookAtPos.y = obj.transform.position.y; // constrain y axis
obj.LookAt(lookAtPos);
This constrains to the global y axis. What I need to do is constrain to the local y axis that can be viewed with the local rotate handle. How is this possible?
↧