Im using HasCollided to change color but I do not want to react to the collision

Hi All, I have a quick question that is probably straight forward but I cant seem to find the answer.

I have particles in Niagara that I want to pass through skeletal mesh. I want them to change color if they have passed through. Im using the collision module and then the HasCollided as the bool to lerp between the start and end color and this works fine.

The problem I have is that I dont want the particles to bounce off of the character. I would like them to just continue on their way.

Hi @demona_aa
My first idea would be to use the events: begin overlap and end overlap in a capsule component that the particles can pass through

1 Like

I don’t think the collision module is designed for that, and even if, you’d still have a bunch of overhead.

Instead maybe build a quick scratchpad where you use the Collision Query Data Interface to check collision.
On gpu you can just check if the sdf is negative. (won’t work for skeletal mesh though)
on cpu raycast over velocity.
Then if you collide do something like this : set Particles.HasCollided to (particles.HasCollided or [result of the collision check])

1 Like

Hi Megatron & Niels, thanks for both of your replys, really helpful. I think im almost there. I created the scratch module and used “query mesh distance field gpu” and connected “isDistanceFieldValid” into set particles HasCollided which then should change the color. Ive checked the project settings to enable distance fields and also checked the static mesh details that is enabled. It doesnt work but im thinking it may be my computer as im wfh im on a laptop with a low end amd apu. i checked the box in the viewport to show distance fields visualization but it didnt seem to change my viewport display. it all looks right so mabey the gpu is the issue. But thanks for your help, there is a cghow vid on collision query that was really useful as well and also the documentation.

1 Like