CPU Particles collision (Mesh Data)

It seems like the module doesn’t work. I spawn single particle that I want to kill on collision with world geometry and skeletal meshes. But particle just pass trough all objects. Is there some special setup needed, or it just doesn’t yet ?

is your static mesh have collision primitive?

Yes, I have been testing with the meshes that are on default level.

I have seen this as well and it happens with Blueprints as well. The same particle system that if placed in the level collides won’t if spawned dynamically during gameplay. However if it’s added as a component to the Blueprint, collision works as expected.

Hi Lukasz and everyone,

Apologies for the delayed response. I have reproduced and reported this issue. Thank you for providing the information.

Cheers

Dear Lukasz,

To assist debugging, could you try using GPU particles in the same context / your spawn code, with a test particle system, and see if you can get them to collide?

If the GPU do collide, then it is your CPU setup

if the GPU dont collide, then it is the setup of the surrounding environment

Is the collision with a landscape?

Rama

Hi Lukasz,

On the Collision module, there is a property called Max Collision Distance. This value defaults to 1000, and once the player camera is further away than that the collision will no longer occur. Try setting this to a higher value to see if that fixes the problem for you.

Cheers

I have set it to 10000, and tried some values in between, but it seems it doesn’t solve my problem. Particle still pass trough all geometry in level, until it dies from reaching it’s emitter duration lifetime.

Should I upload my particle along with some code that spawn it ?

You are welcome to upload just the .uasset and I will take a look a look at it to determine if it is a simple content issue.

Thanks

There it is.
I thought at second that issue might be lack of collision bounds for particle mesh, but it turned out everything is in place.

link text

Hi Lukasz,

I have determined that collision actually is working on this particle. However I had to give the particle an Initial Velocity so I could test this. While moving, the particle stops when it collides with a StaticMesh with collision.

How exactly are you setting things up to test collision? Your particle does not move, so what are you moving for the test?

Thanks

That would explain things I think. Because particle on it’s own doesn’t have any velocity.
As you might have notice from my setup init velocity is parameter and I set this parameter via blueprint, which is in turn passed to code, where I spawn particle.

	if(TrailFX)
	{
		UParticleSystemComponent* TrailPSC = UGameplayStatics::SpawnEmitterAtLocation(Instigator, TrailFX, Origin);
		if(TrailPSC)
		{
			FVector ParticleSpeed = AdjustedDir * TrailSpeed;
			TrailPSC->SetVectorParameter(TrailSpeedParam, ParticleSpeed);
		}
	}

It’s very simple code.

It might be that collision doesn’t work while speed is setup via paramter on spawn ?

I also have a particle system with CPU collision, that is spawned from code. And it too doesn’t collides.

But if I add the particle system to the level, then collision works.

It could be a bug.