Get neighbouring particles by state


Hope everyone is doing well,
So i am pretty new to ice (came from particle flow (1 core woes) and i am trying to get the particles to be attracted/repelled from other particles depending on what state they are in.
So particles in state 1 are attracted to particle in state 2 but stay away from particles in state 3 for example.
I have tried to use the get neighbouring particles by state but cant seem to plug it anywhere into the neighbouring particle force, am i completely missing something, should i be plugging it into something between the two?
Any help would be greatly appreciated.
loving ice so far :slight_smile:


Moving this to the ICE subforum, will try to get back to the question itself too if I have some time and inclination during the week :slight_smile:


ok cheers mate much appreciated.


It looks like the Neighboring Particles Force simply wasn’t designed with states in mind. If you are new-ish to ICE, then the simplest thing to do is edit the existing Neighboring Particles Force.

Inside Neighboring Particles Force, drag in Get Neighboring Particles by State. Plug in the Cutoff Distance from the PassThrough, and replace the Get Neighboring Particles connection from Number Points into Greater Than.

Plug the Points output from Get Neighboring Particles by State into the Source of a Get Data and get PointPosition. Use that to replace the connection from Get Neighboring Particles’ Point Positions output into Subtract. Now you can get rid of the old Get Neighboring Particles.

Expose the State ID and exit the compound. Now you can copy and paste this, change the State ID, and plug them all into an Add Forces. If you want to reuse it in other scenes, change the name (e.g. to Neighboring Particles Force by State) and export.


Lovely, works a treat, thanks a lot for taking the time to help, been going a little crazy with it. cheers M


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.