- Home /
How to get a 3D TextMesh to face character?
I have an rpg with monsters with their names above their heads on a 3D TextMesh. However, some of them have their text backwards. Even ones that have their text forward, when you walk behind it, it's backwards, and when you walk to the side the text is gone. How can I get the rotation of it to always face the character?
Answer by M Poirot · Apr 30, 2011 at 07:48 PM
haven't tested this but
var Camera : Transform ;
function Update () { var rotate = Quaternion.LookRotation(Camera.position - transform.position);
transform.rotation = Quaternion.Slerp(transform.rotation, rotate); }`
could work, the 'Camera' variable is ofcouse the main camera in the game
Your answer
Follow this Question
Related Questions
Switching between multiple classes 2 Answers
Navmesh follow and stop at a distance 2 Answers
Want my camera to only move on a Horizontal Axis 1 Answer
Character Auto Following Main Character 1 Answer
What is better for a game character? 1 Answer