Search Unity

Resolved Visual Effect Renders unexplainable behavior

Discussion in 'Visual Effect Graph' started by DTECTOR, Aug 31, 2022.

  1. DTECTOR

    DTECTOR

    Joined:
    Aug 23, 2020
    Posts:
    132
    So a scene I can attach a sorting group component to a visual effect and it works as expected. It renders on the correct layer. However, if I try to have a visual effect object that plays effects each scene, sometimes it renders under the whole entire scene even though it's on the highest sorting layer, sometimes it plays as if it's masked by an object within the scene and I can only see the effect playing within that specific item while in the scene inspector I an see the particles being sent all over the place.

    I am trying to use the visual effect to generate particles based on a weather condition for the scene.

    I notice that when a visual effect is created in the editor WHILE the game is running, it works as I want it too, which is to have rain falling constantly over the entire scene on the highest sorting layer. Having the effect handled in the scene from runtime it does not work as intended. My assumption is it is creating some sort of weird connection with a parent asset or something under the hood that does not show in the editor. I also tried using the constructor to initialized a new visual effect in each scene to see if that could fix the problem but nothing is created. The constructor doesn't seem to work.

    Is there a way to handle visual effect components so that they behave as intended?

    For example, I have a building on a building layer and an overworld layer that is 6 layers above building layer and 7 above default, yet the rain effect is playing under the default but in one specific building on the building layer I can see the rain dropping within it. So it's playing over the building layer and under the default which is lower than the building layer in the hierarchy of sorting layer render order.

    Could this possibly be a bug?
     
  2. DTECTOR

    DTECTOR

    Joined:
    Aug 23, 2020
    Posts:
    132
    So basically just reboot until it works properly.