Essentially I'm creating a 2D game with 3D graphics in Unity iPhone. To minimise the poly count I have cut the backs off many of the objects because you will only see them from the front. My problem is the "LookAt" code. I'm saying LookAt(Vector2) for a 3D arrow to look at something on the X and Y axis, the problem is when the object passes it on the x axis the arrow flips round to show the back of itself. So for example when the target is to the right of the Arrow its all fine but when it's to the left of the arrow it shows the back of the arrow. Does anyone have any idea how I can just limit the arrow to pointing towards the object and not rotating around itself?
Thanks in advance
asked Aug 12 '10 at 02:36 PM
If I have understood the problem correctly, I think you could use this code instead of "LookAt"
You might have to change the Vector3.forward to something else, and/or add an amount of rotation, based on how your current setup is.
Does this solve the problem?
answered Oct 29 '10 at 12:34 PM
have you tried using a configurable joint assigned to the 3d arrow? You can use it to lock rotation to certain axes pretty easily.
answered Sep 07 '10 at 07:13 AM