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

[VFX Graph] - Particles disappear after setting world position

Discussion in 'Graphics Experimental Previews' started by turboturboturbo, Nov 23, 2019.

  1. turboturboturbo

    turboturboturbo

    Joined:
    Dec 2, 2018
    Posts:
    25
    Hi,

    My particles are unexpectedly disappearing/reappearing.
    (When I move the camera towards the particles, they disappear. When I move camera away from particles, they reappear.)

    This happened after setting the world position (it was working fine before).
    I have no clue what to do - any ideas?

    Code (CSharp):
    1.  VFXEventAttribute _attrib = vfxPrefab.CreateVFXEventAttribute();
    2. _attrib.SetVector3("position", position);
    3. _attrib.SetFloat("lifetime", duration);
    4. _attrib.SetVector3("color", new Vector3(color.r, color.g, color.b));
    5. vfxPrefab.SendEvent("OnManualSpawn", _attrib);


     
    Last edited: Nov 23, 2019
  2. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    Happened to me today. I can see from the screenshot that your System is set to Local, but the values in the Bounds block are expressed in World Space. So maybe your particles are being culled?

    This could be possible because you expect the particles to be somewhere in the scene, but their bounding box is at the origin so when you don't see it the particles are culled, and disappear.
     
  3. svjetlonosha141

    svjetlonosha141

    Joined:
    Jul 1, 2021
    Posts:
    4
    Hey, I just had the same problem after a day of trying different things I finally realized what's the problem.
    You have to increase the bounds within the VFX (for example, for me it fixed the problem when I set the size to 20, instead of the inital 5x5x5) + make sure its local
     

    Attached Files: