Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Scroll Rect putting NaN on target content transform in small scaled world canvas

Discussion in '5.6 Beta' started by Rational-MA, Mar 21, 2017.

  1. Rational-MA

    Rational-MA

    Joined:
    Mar 6, 2015
    Posts:
    59
    We are having major issues on components with ScrollRect and non-overlay canvases using 5.6.
    In this specific issue, we have a table-like component in the a world space UI canvas with a ScrollRect. The canvas is scaled very small and the ScrollRect is setting NaNs on the transform of the target content. These NaNs are causing all sorts of display issues as well as exceptions in code that needs to look at those values.

    This same setup has been working on 5.5. In fact, 5.6 b1 does not put the NaNs, they start on 5.6 b2 up to current 5.6 f1

    Bug report with example project filed: (Case 893559) ScrollRect putting NaN on Content transform in 5.6

    Update:
    Here's a description and attaching the test scene here:
    a. Using Unity 5.6 (any version after 5.6b1 up to and including 5.6f1), open attached project
    b. Open the WorldTableTestScene
    c. Play the scene
    d. In the editor, inspect "Canvas - Scale 1 -> Body (this holds the ScrollRect) -> Sizer (the scroll rect's content)", notice the scale of the canvas is 1 and the Sizer's transform contains valid numbers
    e. Now, inspect "Canvas - Scale 0.01 -> Body (this holds the ScrollRect) -> Sizer (the scroll rect's content)", notice the scale of the canvas is 0.01 and the Sizer's transform contains NaNs. These NaNs even sometimes persist after the play scene is stopped.

    Randomly this will also throw a lot of Assertion failed on expression: 'IsFinite(outDistanceForSort)' messages as well.

    This is the issue and it was not present in 5.5 nor in 5.6 B1. The issues exist with every 5.6 from B2 onwards.

    Update 2:
    Another bug report filed for opening dropdowns in a canvas set to screen space - camera blocking the UI. I cannot see the native code for the dropdowns, but I have a hunch it is related to scroll rect issues as well. Could be separate, but just a hunch, here is info on that
    https://forum.unity3d.com/threads/o...-when-in-a-screen-space-camera-canvas.462197/
     

    Attached Files:

    Last edited: Mar 21, 2017
  2. saviemedia

    saviemedia

    Joined:
    Nov 8, 2016
    Posts:
    7
    Hi Rational-MA, did you manage to fix the Dropdown issue?

    Thanks
     
  3. Rational-MA

    Rational-MA

    Joined:
    Mar 6, 2015
    Posts:
    59
    Konst likes this.
  4. davebuchhofer

    davebuchhofer

    Joined:
    Nov 9, 2007
    Posts:
    126
    Thanks Rational, running into that issue here as well.