Question by
EvilCensor · Apr 03, 2017 at 04:09 PM ·
positiontextlookat
Text Over Object That Faces Camera
New to Unity and have a problem (which I understand is probably obvious) with the code below.
Part 1 works and places centered text over an object - however although 2 and 3 makes the text always face the camera - the text is no longer centered upon the object. Can anyone help understand how to get 2 working as desired with 1?
public FirstPersonController fpc;
fpc = GameObject.FindObjectOfType<FirstPersonController>();
// 1
TEST_text.transform.position = new Vector3 (TEST_shape.transform.position.x - (p1.x / 2), TEST_shape.transform.position.y + 3.5F, TEST_shape.transform.position.z + 0);*
// 2
TEST_text.transform.LookAt(fpc.transform);
// 3
TEST_text.transform.Rotate(0, 180, 0);
Comment
Your answer
Follow this Question
Related Questions
Find screen position of a specific word in a RichText? 1 Answer
how can i set a sprite to a fixed position? 1 Answer
Have a character constantly face an enemy. C# 0 Answers
LookA() Text object is turning backwards to the camera 1 Answer
How to properly update caret position when modifying TMP input field with Rich Text ? 0 Answers