# Niagara ScratchPad Custom Collision 

**URL:** <https://forums.unrealengine.com/t/niagara-scratchpad-custom-collision/2674261>\
**Category:** Asset Creation\
**Tags:** particle-systems, unreal-engine\
**Created:** [November 12, 2025, 3:52pm UTC](https://forums.unrealengine.com/t/niagara-scratchpad-custom-collision/2674261 "2025-11-12T15:52:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SeverynB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SeverynB](https://forums.unrealengine.com/u/SeverynB)\
**Post date:** [November 12, 2025, 3:52pm UTC](https://forums.unrealengine.com/t/niagara-scratchpad-custom-collision/2674261/1 "2025-11-12T15:52:45Z")

</div>

HELP i need somebody!

I have an emitter that spawns exactly two particles at random positions. I want them to attract each other, collide once, and then fly apart. To keep it highly optimized, I’m avoiding physics-based collisions and instead using a custom Scratchpad module in **Particle Update** :

1. Using **Particle Reader Attribute** and **Particle Index** , I fetch the position of each particle.

2. I compute the midpoint between the two particles to drive an attractor force.

3. I calculate the current distance between the particles.

4. I created a float particle attribute, **Particles.HasCollided** , to store collision state.

5. I compare the current distance with a **CollisionDistance** input (float). When distance \< CollisionDistance, that comparison returns **true**.

6. I also check whether **Particles.HasCollided \> 0**.

7. I OR these two booleans to get the current collision state.

Intended logic:

1. At start, **Particles.HasCollided = 0**.

2. When the distance test is true, the OR node becomes **true**.

3. The OR result sets **Particles.HasCollided = 1**.

4. From then on, **HasCollided** should remain **true** , so I can use it in force logic to push particles apart and keep them apart.

Problem:

For some reason, this setup sets **Particles.HasCollided = 1** at the very beginning, even though I explicitly initialize it to 0 in **Particle Spawn**.

Question:

Is there a way to make this logic work as intended?  
Or, is there another low-cost method to detect/handle a “collision” between just two particles?

 ![Collision_02](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/8/4/38438e93e663610959ef86d3394cde1ca828b625.jpeg)

 ![Collision_01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/5/e353b65fa234ad07caee660e9db3b5592712de46.jpeg)
