Enable CCD via blueprints?

hey, how can i enable and disable CCD (continuous collision detection) for a mesh, in blueprints event?
can’t find the right node for it. thanks in advance.

I don’t think you can toggle this dynamically. I believe you can only set it via details panel.

i saw C++ version of doing it dynamically somewhere, couldn’t find the blueprint analogue by the name though :frowning:

bump please

How are you turning on CCD statically?

Are you talking about being able to poll every frame, sweep when moving to avoid going through things, or just testing for overlaps or resting collision rather than hits?

i need my mesh to generate hit events on very high speeds (it is not a projectile though), as well as block with them.

i turn it statically via checkbox in the actor that uses this mesh.
i want to control that option dynamically to save performance when CCD is not required.

I just went through the code, and I think you have to update C++ for this. The flag is passed directly into PhysX. It’s read only in the “BodyInstance” struct associated with the mesh.

You can see what I mean by searching through the code for bUseCCD.

One think you could possibly do is have two copies of the mesh - one marked UseCCD, the other marked not. Set only one visible in game so it’s drawn once. Then it looks like you can use SetCollisionEnabled() to set one collidable and the other not (and vice versa).

It’s a little awkward, but I don’t see a better way to do it.

thank you for the answer! does editing bUseCCD dynamically affect the collision setting, or only works at initialization?

if it is, i think it will be good for my case to make some C++ abstract class as a base for my blueprint actor, which will add a function to dynamically change that bool.

UE4.19 new feature

Added "Set Use CCD" function for changing Continuous Collision Detection option at run-time

src=https://www.unrealengine.com/en-US/blog/unreal-engine-4-19-released