2D Rotation Toward Touch

I have what I thought was a very trivial issue. I need to rotate my sprites (created using Sprite Manager) toward the position of a user touch. I've read through and tried numerous responses to similar questions without success. Most of these involved a permutation of "transform.LookAt()" or "Quaternion.LookRotation()".

My sketch below simplifies the problem. Basically the user touches the screen, this point is converted to world coordinates and stored as the target. As a simple sprite moves about the scene it is always rotated to point at the target.

alt text

In my case this rotation would occur on "z". X or Y rotation places the sprite in a non-viewable state.

Any insight or solution is greatly appreciated!


Hey Brian,

I don’t have an answer, but I love the sketch.

Just sayin. :slight_smile: