I’m new to Unity and have an issue where I’d like some text to be placed above an object (works fine) - but continues to face the camera as it moves.
The following works. (1) places the text above the object and centers it. However I’m not sure how to apply (2) to (1) correctly.
As it stands the text will face the camera but it’s no longer centered over the object when I use the transform.lookat code is applied.
//======
var p1 = FOLK_text.GetComponent().bounds.size;
FirstPersonController fpc = GameObject.FindObjectOfType();
(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);
//======
Pointers appreciated.