Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Misinformation in documentation for the Formula node

Discussion in 'Visual Scripting' started by JoCronk, Oct 15, 2022.

  1. JoCronk

    JoCronk

    Joined:
    Aug 3, 2013
    Posts:
    2
    We are using Visual Scripting package 1.7.6 with Unity 2021.3.1f1.

    According to the 1.7 documentation for Formula, it says Round "rounds a value to the nearest integer or specified number of decimal places," and provides an example of "round(3.222, 2)".

    https://docs.unity3d.com/Packages/com.unity.visualscripting@1.7/manual/vs-formula.html

    However, attempting to use Formula to round 3.222 to 2 decimal places results in this error:

    ArgumentException: round() takes at exactly 1 arguments. 2 provided.

    If it's using Mathf.Round (which only takes 1 argument and returns the nearest integer), the Formula documentation should be updated to reflect proper usage.
     
  2. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    222
    confirmed to not work as described in the documentation
    Capture.PNG Capture1.PNG Capture.PNG
     
  3. Welfarecheck

    Welfarecheck

    Joined:
    Jun 14, 2020
    Posts:
    117

    The round has never worked. It has been reported by various people over they years, so work around it with multiply/divide.

    The new version that Unity is working on should be quite a bit better and have all these bugs fixed, but no one knows when it will be released. :D
     
    REDACT3D_ likes this.
  4. ericb_unity

    ericb_unity

    Unity Technologies

    Joined:
    Nov 24, 2017
    Posts:
    167
    REDACT3D_ likes this.