Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Bug Unity 2021.2 regression: Handles disappearing

Discussion in 'Editor & General Support' started by Aka_ToolBuddy, Nov 20, 2021.

  1. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    363
    Hi

    I have encountered until now three different serious regressions introduced by 2021.2, all handles related. I am surprised that (seemingly) no one is complaining about it over here. Am I missing something?

    I draw a custom position handle for my Temp class. Here is the code for it:

    Code (CSharp):
    1. using System.Runtime.CompilerServices;
    2. using UnityEditor;
    3. using UnityEngine;
    4.  
    5. [CanEditMultipleObjects]
    6. [CustomEditor(typeof(Temp), true)]
    7. public class TempEditor : Editor
    8. {
    9.     protected virtual void OnSceneGUI()
    10.     {
    11.         Temp temp = (target as Temp);
    12.         Vector3 position = temp.transform.position;
    13.         float handleSize = HandleUtility.GetHandleSize(position);
    14.  
    15.         Vector3 delta = Vector3.one * handleSize;
    16.  
    17.         temp.transform.position = Handles.PositionHandle(position + delta, Quaternion.identity) - delta;
    18.  
    19.     }
    20. }
    21.  
    And here is the actual Temp class:
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class Temp : MonoBehaviour
    4. {
    5. }
    6.  
    If I select an instance of my class while using Unity 2021.2.0f1, both handles appear. If I do the same but using 2021.2.2f1, my custom handle is not displayed.

    The other issues are all related to other methods of the Handles class, but for the sake of briefness, I discussed only Handles.PositionHandle. I did report all those bugs to Unity.

    Any help is welcome
     
  2. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,263
    You do. 2021.2.3f1. And threads all over the forum about transform handles. Now, I haven't tried your specific case because I can't at the moment, but the lights and camera transform handles are fixed, I will assume your custom handle too. If your problem persists after upgrading to 2021.2.3f1, submit a proper bug report.
     
    Aka_ToolBuddy likes this.
  3. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    363
    Thanks a lot, the issue was indeed fixed in 2021.2.3f1.
    I thought about it and first read the release note, looking for an entry about a fix for handles, before reporting the bug to Unity, and found nothing.
    Thanks again
     
    Lurking-Ninja likes this.
  4. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    363
    Only one of the three issues I witnessed is not yet fixed in 2021.2.3f1, which is the position of labels drawn using Handles.Label is different between 2021.1 and 2021.2. I reported the issue to Unity about a week ago, waiting for an answer.
     
  5. pawelduda

    pawelduda

    Joined:
    Feb 1, 2019
    Posts:
    35
    @Aka_ToolBuddy Have you received any info? Can you provide a link to issue tracker?
     
  6. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    363
    No answer yet. Unity's customer support haven't created yet an issue on https://issuetracker.unity3d.com

    Also, if this might help anyone, I have reported another issue, with no answer neither. It is also a regression introduced in Unity 2021.2, where you get the following message if you open an object selector from inside a custom window, under some circumstances:
    GUI Error: Invalid GUILayout state in <EditorWindowName> view. Verify that all layout Begin/End calls match
     
  7. Aka_ToolBuddy

    Aka_ToolBuddy

    Joined:
    Feb 25, 2014
    Posts:
    363
    Last edited: Dec 2, 2021
unityunity