I come to you after days of trying to solve what should be a simple issue, but can't wrap my head arround it. I will try to be concise as I tried many many different setups, achieving parts of my goal but was not able to glue everything up correctly.
Context : I have a node setup that makes particules bounce arround a geometry. It works nice, with different geometries or number of bouncing points.
Main objective : Flag the closest point of the collision wall on collision and keep it flagged after collision. Meaning for ex. switching an attribute state of a point of the wall to True and keep it to True after the collision.
This leads me to have the following issue :
Is it possible to easily freeze an attribute value under a certain condition, and keep it frozen, even after the collision is False again ? This is possible in simple cases but not in my main setup.
What I want : when a colision happens, the closest point of the bouncing geometry gets permanently flaged with an attribute. Idealy, this attribute can be increased temporally (like an age attribute), or just be the frame number at which the collision happens.
I initially had this setup, which works fine : when a collision happens, the closests points in the collision geometry appear :
The bouncing points collision mouvement is not inside this node tree, I just get the point as input to the left. What I do here is change the freeze attribute when the points are in the given range. Then the points are deleted acordingly to only keep the points that were flagged. I also want to add an age attribute.
It works flawlessly, but to make it work fine, I need to have a large radius for collision detection : But it leads to having many points appearing. What I ideally want, is only the closest point to appear.
I tried adding a condition to only keep the closest one, but it does not work : the sample index need an index attribute to choose from the bouncing points. This setup does not work :
After this attempt, I knew that I could make something simpler and less specific by just flag the points and do all the deleting stuff later. I though it was better as I keep the point cloud, just change the attributes, and change the point cloud later.
I made this setup that correctly flags the closest point in range, when the collision happens:
It works fine, for any number of points. Now I just needs to keep the points flagged. (meaning keeping the attribute state after the collision). And I was not able to figure it out. Something in my setup does not work and I do not know why : I can't merge the simulation part (keeping the attribute value) and the multi-points part (the for each part)
I tried this setup : The attribute count is intially at 0.0. When a point is flagged, it is added a value of 1, each time a collision happens. My idea was to use a simulation node after this for each setup, to just add this value of the count attribute to itself, clamping it, so I can "remember" this value over time, thus technically freezing the attribute in place.
This gave me the following setup :
After the for each setup, I take my points in a simulation node setup. Inside, I add to itslef the value of 1, just like you could do for an age attribute. But I clamp it, and only do it for the "frozen" points, meaning the points where a collision happens. This should in theory, continuously keep the count attribute of points that already had a collision to a value of 1.0, allowing me to later filter those out.
But this setup does not works. It works for some points, but not all, and I cannot understand how. All the points seem to be correctly flagged (the multipoint setup seems to work fine) but after the simulation, the values are not kept correctly, and I was not able to identify what goes wrong. I did try this idea of "increasing an attribute" to keep the points that had a collision in a other and simpler setup, and it worked perfectly : (it is also in the blender file) :
But it does not work with my points main setup.
I also tried another less elegent solution, which is just putting evrything in a simulation node, effectively joining all the points each steps, and using a merge by distance node to avoid having to many points. But this cause some issues on the count attribute whose value depends on the number of points that are bouncing. (The merging dividing the attributes values I guess).
So, finally, my questions are :
- How I am supposed to achieve this collision-detection-attribute-transfer system ? Is there a way simplier way to do it that I missed ?
- Is it possible to freeze attribute when a condition is reached, in a simplier way that I tried ?
Thank you very much for any advice that could help this situation.
Have a great day,






energy, what you want instead is to use a switch as in Gordon Brinkmann's answer, and set the value to current frame number if the value is 0 (it won't be confused with frame number 0 if you start your animation on frame 1), otherwise just decrease it by one. $\endgroup$