Landscape " Collision Thickness" no longer a viable option?

Hey all,

I have been making use of the landscapes “Collision thickness” property to detect if an actor has been placed under the landscape up to a specific Z range. This has worked in prior versions of the engine. However it has come to my notice that this property fails to be of use within 4.14.

Has this property been deprecated? Is it a bug? Am I missing something obvious?



For anyone else who has experienced this issue, here is the situation :

“PxHeightFieldDesc::thickness has been deprecated, as the new unified height field (see PxRegisterUnifiedHeightFields()) does not support thickness any longer.”

If you are using UE4 4.14 or later you will no longer be able to use the ‘CollisionThickness’ property in your landscape actors, as the underlying code is deprecated. It looks like Epic forgot to mark this property deprecated when the PhysX SDK change ocurred, with the result that it’s just a dangling variable which doesn’t actually do anything.

If you are using a source build of UE4 you can hook it up again, however! In PhysLevel::InitGamePhys() you will need to call PxRegisterLegacyHeightFields() rather than PxRegisterHeightFields(). You will also need to modify ULandscapeHeightfieldCollisionComponent::CookCollisionData() so that it passes the CollisionThickness parameter to CookHeightField(). (You will also have to add thickness back in as a parameter).

So, yeah. It’s fixable but you will need to do abit of engine work. Thankfully they left the legacy heightfield functionality in the SDK!

Dood…lifesaver! Works like a charm :slight_smile: