Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Custom Event Attribute not accessible from script

Discussion in 'VFX Toolbox' started by AssetStoreFJ, Jun 8, 2020.

  1. AssetStoreFJ

    AssetStoreFJ

    Joined:
    Nov 22, 2016
    Posts:
    2
    Hi,

    I am currently using 2020.1.0b11 but have also tried this in 2019.3.15f1.

    I am trying to set up a single VFX Graph that can trigger a Muzzle Flash, Projectile, and Hit Effect each time the user fires the weapon using events with custom attributes to position and orientate the particles.

    Whenever I set custom event attributes and then attempt to access they via script via something like this:

    var visualEffect = GetComponent<VisualEffect>();
    var vfxEventAttribute = visualEffect.CreateVFXEventAttribute();
    Debug.Log(vfxEventAttribute.HasVector3("TestV3"));

    HasVector3 returns False;

    I have attached a screenshot of the graph and the inspector showing how the custom event is setup.

    I might be missing something but it appears to me as if the custom event attributes are not really working.

    Any help in this regard would be massively appreciated.
     

    Attached Files:

  2. AssetStoreFJ

    AssetStoreFJ

    Joined:
    Nov 22, 2016
    Posts:
    2