Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved How to rotate UI in World space without flickering?

Discussion in 'Scripting' started by Nightland_Driver, Mar 15, 2023.

  1. Nightland_Driver

    Nightland_Driver

    Joined:
    Nov 21, 2021
    Posts:
    13
    Hey,
    I have a Problem with my Chat Box UI.
    The Chat Box is in the World space and Should rotate to face the player's Cam.
    But if I rotate the UI, then the Chat box Text and Icons start to flicker.
    Video:


    How can I get rid of the flickering?

    I Use this in the Update to rotate the UI towords the Player Cam.
    Code (CSharp):
    1. private void Update() {
    2.         this.transform.LookAt(transform.position + Camera.main.transform.rotation * Vector3.forward, Camera.main.transform.rotation * Vector3.up);
    3.     }
     
  2. RadRedPanda

    RadRedPanda

    Joined:
    May 9, 2018
    Posts:
    1,596
    Looks more like there's clipping problems, as if there's something in the same spot as your dialogue box, but there's not really enough information to go off of.
     
    Nightland_Driver likes this.
  3. Nightland_Driver

    Nightland_Driver

    Joined:
    Nov 21, 2021
    Posts:
    13
    Hey,
    Youre right. Thanks for the help and the quick reply.
    I just deactivated every single element piece by piece to find the problem. There was another object, which caused the clipping.