Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: beforethelight on November 23, 2012, 03:08:15 AM
-
I am just wondering if there is a function for making a sprite look at a object. I have a 2d lander game and I just want to have a arrow in the ui that points to the landing zone. everything i try ends up working with the z axis pointing at the object, where for a 2d I need the y to point at the object. Thanks.
-
Ok so not how I had hoped to fix this but I added a game object that is offset by the amount off target and made my arrow a child. This is ok but I really dont like what it. Is there any way to have a waypoint marker move around the edge of the screen pointing in the direction of the landing zone? Any info would be great. Thanks
-
It's a math question rather than an NGUI question. Knowing that the sprite's normal orientation (rotation 0) makes it point up (assuming your sprite points up), figure out the angle between the 2D up vector and the 2D direction to your object (widgetPos2D - objectPos2D).