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 Is there a way to condition a spawn event?

Discussion in 'Visual Effect Graph' started by DanielleBBI, May 12, 2022.

  1. DanielleBBI

    DanielleBBI

    Joined:
    Mar 28, 2018
    Posts:
    30
    Hello! I have a spawn event that is triggering a subgraph
    Is there a way to gate that spawn event to only trigger when a specific variable is set to true? or is the only way to limit emission on the subgraph?
    upload_2022-5-12_13-24-43.png
     
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,296
    The easy way is to set Count in Single Burst to 0 when you need it, but I guess you still want to spawn particles somewhere below where green connection goes. In this case as you said you would need to do that stuff inside subgraph or just use separate event.
    Or actually, you could chain Spawn contexts and put another one (between subgraph and Spawn) and set spawn count to 0 there, so this value is passed to the subgraph.

    Maybe it will be possible in future with this: https://portal.productboard.com/uni...s/c/99-boolean-ports-to-enable-disable-blocks