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 What are OnStop event attributes good for?

Discussion in 'Visual Effect Graph' started by fleity, Nov 23, 2022.

  1. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    337
    The timeline Visual Effect Activation track (or rather it's clips) have the ability to send event attributes which makes sense to me since the api behind both is just SendEvent and that function has that parameter but what would / could you use this for?

    Maybe I am not seeing it but since Stop ends emission whatever one could send through that event would not matter anyway?

    I am asking out of curiosity is there any example where this is used?
     
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,291
    Never used timeline with vfx, so maybe this makes no sense, but what about this?
    upload_2022-11-23_14-4-21.png
     
  3. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    337
    Ah yes I see, because otherwise I would need to send two events each: OnPlayA (with attributes), OnStopA(events do not matter), OnStartB (again with attributes), OnStopB (again events do not matter).

    The timeline clip always sends both Play and Stop (because every clip always has a beginning and an end) but if used with other scripts and a setup like that it does make sense.