Text that always looks at you
I've tried to make GUI text face the camera but all the other scripts i found on unity answers did not work and made the text move. I want the text to face the camera and have locked movement and only change in x y z always facing the camera.
Do you mean you want the text to be like a HUD where it stays in one spot on the screen, or do you want something like a sign somewhere in your game with words on it for the player to read?
I want it to be a sign but the text always rotates so it looks at the camera
Have you tried putting a script on the text, and use: "Transform.LookAt(Camera)" in the Update?
ive tried but it errors me if i put uppercase Transform it gives me error CS0120: An object reference is required to access non-static member UnityEngine.Transform.LookAt(UnityEngine.Transform)' if i put lower case transform it puts: Assets/Scripts/textFollow.cs(19,27): error CS1503: Argument
#1' cannot convert UnityEngine.Camera' expression to type
UnityEngine.Transform' and Assets/Scripts/textFollow.cs(19,27): error CS1502: The best overloaded method match for `UnityEngine.Transform.LookAt(UnityEngine.Transform)' has some invalid arguments
Answer by Cynikal · Aug 10, 2016 at 06:27 PM
(Continued from Comments) I just tried it with the following:
using UnityEngine;
public class TestFace : MonoBehaviour {
// Update is called once per frame
void Update () {
transform.LookAt(Camera.main.transform);
}
}
And it worked fine.
it works but the text moves to the right of the target and rotates 180 degrees