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. Dismiss Notice

Question Problem with Event Attributes.

Discussion in 'Visual Effect Graph' started by GB_DEV, Aug 25, 2023.

  1. GB_DEV

    GB_DEV

    Joined:
    Sep 20, 2018
    Posts:
    3
    No matter what I do, I can't seem to get anything to work. I just want to set the spawn location of my particles. The documentation on this is legendarily poor, I've even read the ebook and there's just barely anything.
    I've tried:
    • passing it in as a custom attribute and setting it in the Initialise event.
    • passing it in as a custom attribute and setting it in the Spawn event.
    • passing it in as the position attribute.
    • passing it in as the position attribute and inheriting from source in my init.
    My code looks like this:
    VFXEventAttribute eventAttribute = pullVfx.CreateVFXEventAttribute();
    eventAttribute.SetVector3("position", hitPoint.Value);
    pullVfx.SendEvent("PullTrigger", eventAttribute);

    And my vfx graph looks like this:

     
  2. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    134
    Last edited: Aug 25, 2023
  3. GB_DEV

    GB_DEV

    Joined:
    Sep 20, 2018
    Posts:
    3
    Hi, reimporting the visual effect graph package seems to have solved my issue. Thank you for the reply. Qriva's resource is indeed very useful, as is the visual effect ebook (which seems to have a lot of content that would be useful in the docs). It would be nice if the vfx graph could also be cleaned up, a lot of stuff just isn't packaged into a nice UX, especially the whole attributes system. There's a big lack of tooltips. You can also connect "Get Source Attribute" nodes to the "Spawn" section which causes a huge number of errors in the console like "Error: code 492 not found".

    P.S. I am curious, is there no redirect node in vfx graph? I'd assume shader graph and vfx graph are built on the same foundation, it's weird it's not in vfx graph but is in shader graph.