- Home /
Rotating 2D sprite to match surface.
Hi, I am having a problem involving the rotation of a 2D circle sprite.
The objective is to rotate the circle so that the base of it is matches a specified point of contact with the surface that it is on*(I have this point)*. The program taking into account the circle can be at a random rotation before making this adjustment.
I am new to rotating objects in unity and have been experimenting with euler angles/quarternions but no luck. Any suggestions one what I could do to achieve this?
Thank you in advance, Jack
Depending on what you want to do, it could be useful to retrieve the normal of the surface point (with a raycast for example).
The normal is a direction. You can then rotate your circle towards this direction.
Some useful threads for that: http://answers.unity3d.com/questions/654222/make-sprite-look-at-vector2-in-unity-2d-1.html http://answers.unity3d.com/questions/585035/lookat-2d-equivalent-.html
I've made an assumption on what it is you want to do... if you could be more precise it would help to answer.
Your answer
Follow this Question
Related Questions
2D : Rotation of Object With x-y Axis 2 Answers
problem with rotation 2D 1 Answer