UE4 C++ Hint 2: Programmatically starting a UDestructibleComponent with physics on (in a subclass)

THE ISSUE

You’ve got a UDestructibleComponent as an object within your AActor subclass and you need it to start with physics turned on, normally done using:

Object->SetSimulatePhysics(true)

But this doesnt seem to work on your blueprints!

THE SOLUTION

Instead try

Object->GetBodyInstance(NAME_None, false)->SetInstanceSimulatePhysics(true)

The Bool will now be set on the BP by default!

Categories: