Skip to content
Snippets Groups Projects
Select Git revision
  • 38f6c0cb9fa3878cfb564a819d08f6b87800a3d4
  • main default
  • master
  • tempAndrToMaster
4 results

AlignText.cs

Blame
  • AlignText.cs 610 B
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class AlignText : MonoBehaviour
    {
        // Start is called before the first frame update
    
        public Camera Cam;
    
        void Start()
        {
            Cam = Camera.main;
        }
    
        // Update is called once per frame
        void Update()
        {
            transform.forward = Cam.transform.forward;
            //Not yet the perfect solution
            //Problem is the relative rotation of the TextMesh to the Line-Parent
            //transform.rotation = Quaternion.Lerp(transform.parent.transform.rotation, Cam.transform.rotation, 0);
        }
    }