Search Unity

Question Get Particles - Particle missing from nodes

Discussion in 'Visual Scripting' started by Welfarecheck, Sep 29, 2022.

  1. Welfarecheck

    Welfarecheck

    Joined:
    Jun 14, 2020
    Posts:
    120
    How can I create an array of particles for Get Particles?

    https://docs.unity3d.com/ScriptReference/ParticleSystem.GetParticles.html

    I can get the particle count but there is no set of nodes for getting the particle itself and manipulating them. Nor is there a list of particles array option to create the array to get the particles that I can't seem to use. I'm guessing particle isn't public like all the other particle system settings?
     
  2. Welfarecheck

    Welfarecheck

    Joined:
    Jun 14, 2020
    Posts:
    120
    Disregard. After I did a restart of Unity it popped up with the Particle. I searched that sucker 20 different ways and then it popped up after the restart. Shrug.

    The only thing needed is the Particle of Particle System. The List of Particle is misleading. Don't use that but instead use an AOT list by adding the blank particles to the list and overwriting them with the current particles.

    upload_2022-9-29_17-21-16.png


    Example script:

    upload_2022-9-29_17-20-3.png
     

    Attached Files:

    Last edited: Sep 30, 2022
    REDACT3D_ likes this.
  3. Welfarecheck

    Welfarecheck

    Joined:
    Jun 14, 2020
    Posts:
    120
    Final product for syncing particles over the network. This will work with Fish Networking, Mirror, etc. Same process for all of them with different RPC calls to get the array of positions to the clients.

    upload_2022-9-30_9-13-41.png
     
    Last edited: Sep 30, 2022
  4. Trindenberg

    Trindenberg

    Joined:
    Dec 3, 2017
    Posts:
    398
    Surely updating particle positions on multiplayer can be abstracted to there being particles emitted? Depending how many particles but might be a bit slow, also heavy on traffic?
     
  5. Welfarecheck

    Welfarecheck

    Joined:
    Jun 14, 2020
    Posts:
    120
    This is for syncing the initial state, future destroys for connecting clients, and resyncing periodically when players open one of the full screen menus. It's not going to be on update. Sending a seed for the particle system won't reflect what has already been destroyed on the server because what destroyed them isn't a static object.

    Each particle system has 20 objects and any number can be destroyed until they hit 0 and the particle system despawns. The particles are infinite in duration as well so as long as the time and particle positions are initially synced, they should be pretty close to being in the right spot at all times for everyone.
     
    Trindenberg likes this.
  6. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    222
    beauty good stuff
    and thanks for sharein' your results
     
  7. Welfarecheck

    Welfarecheck

    Joined:
    Jun 14, 2020
    Posts:
    120
    Working really well in testing. Here I have 4 clients with 15,000 turtle NPCs synced across the network. Each player can attack the turtles and kill them as particles in real-time between all the clients. But, that's not really the goal. When you attack the NPC, NPC from the spawned pool will replace the destroyed particle with a little animation and that NPC will do all the attacks. Hot swapping NPCs.

    Very cheap way to fill the world up with NPCs that move around with noise.

    upload_2022-9-30_14-46-45.png
     
    REDACT3D_ likes this.
  8. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    222
    Great idea using the particle system. look at all those guys running around lol