- Home /
2D Sprite rotation but still face the camera?
Hello, i am currently have a 2D sprite which is an enemy indicator arrow (radar effect). it faces towards the camera in my 3D game and it\ moves around the viewport edges as the enemy outside of the viewport changes location in relation to the viewport.
Now the problem i am having is that i can't get that same indicator arrow to rotate to point at the viewport border (where the enemy is) while still keeping its face towards the camera. So how would i rotate a 2D sprite while still facing the camera?
Right now i am trying to make the sprite look towards the camera and then change the z rotation but this doesn't give the result i want.
transform.LookAt(camera.transform.position);
transform.rotation = Quaternion.Euler (0, 0, angle * Mathf.Rad2Deg);
Your answer
Follow this Question
Related Questions
Want to rotate camera horizontally around object using left and right arrow keys 0 Answers
2D sprites with 3D camera - Change sprite upon rotation - Strange "jitter" 0 Answers
perpendicular sprites towards camera 1 Answer
Sprite facing multiple cameras? 1 Answer
Animator recording and playing 2D sprite bone rotation in the wrong direction 0 Answers