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

Question How do you use World to Local without error log spam?

Discussion in 'Visual Effect Graph' started by dgoyette, Sep 3, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    I'm trying to do something fairly simple: Change a position from world space to the VFX's local space. I'm using this:

    upload_2020-9-3_16-12-29.png

    That seems to give the correct result, but it also generates endless error log spam:

    I tried toggling the "L" to "W" on the Transform input. That halts the log spam, but it also seems to produce the wrong position.

    Is there a different way to convert from a world position to a local position in a graph?
     
  2. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    146
    Hello !

    This Assertion is unexpected, we had an issue about this, we are going to investigate. Thank you for reporting and sorry for the inconvenience.
    Can you indicate your Visual Effect Graph package version ?

    About convert any spaceable input from a space to another, there are several way to do this.

    Using your example, this kind of graph already does a transformation from World to Local to fit the expected system space :
    upload_2020-9-7_22-15-24.png

    Alternatively, you can use the Change Space operator to process it outside the context (the green arrows are representing a value transfer without any space transformation) :
    upload_2020-9-7_22-32-49.png

    Note that in the first case, we are using a Vector while the second solution uses a Position. You can use the cogwheel to change the kind of input (Position, Vector or Direction) :
    upload_2020-9-7_22-27-34.png

    Your solution using an explicit Transform operator is also valid. Using one approach or another hasn't noticeable performance impact and it generally leads to the same graph execution.
     

    Attached Files:

    Last edited: Sep 7, 2020
    Mockarutan likes this.
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    Thanks very much for pointing out the "Change Space" node. I missed that.

    Also, I'm using 7.4.3 in an HDRP project under 2019.4 LTS.