Collisions doesn't work at BeginPlay against Instanced Meshes if their Mobility is Static

Here’s a small project to reproduce it, just open “TestLevel” and hit Play.

The bug has been introduced in 4.8, it didn’t happen at 4.7.

On my project only happens in PIE, but on this smaller project happens on both PIE and standalone builds.
If you set the delay on the delayed actor to 0.016 or lower works fine in PIE but breaks on standalone. Also if you move the actor on Tick(), it happens the same, so it’s likely not just BeginPlay() but the whole first frame.

Hi TS100101,

Deferred creation of physics bodies, ie creating them over multiple frames, was added in 4.8 to prevent hitches when streaming in levels with ISMCs with large numbers of instances, eg foliage. I’m not sure if it’s feasible to make sure they’re all created before BeginPlay occurs, but I’ve added ticket number UE-18019 to look at that possibility.

There’s a flag bCanDefer inside InitBodies_PhysX() in BodyInstance.cpp that is true only for components with static mobility which is what you’re seeing. If you’re using source code you could disable that behavior.

I think we only need to solve the problem with the BeginPlay, because in the case of the Tick example you shouldn’t be moving objects with static mobility in Tick. If they have Movable mobility the body creation would not be deferred in any case.

Hi JackP.

I’m not moving the ISMCs neither in BeginPlay nor in Tick, I’m moving a movable actor against the static ISMCs. Did you check the example project ?

I can understand how deferring the load of things like foliage can be acceptable, but if you use ISMCs for walls or for the ground, this behaviour can totally break the game so I think it should be optional, ideally on a per component basis.

Thanks for the bCanDefer tip, but sadly my current PC is quite dated and working with the source version of the engine is horribly slow. I plan to upgrade it soon, though.

Hi,

With regard to Tick I was just responding to the part of your comment where you say

Also if you move the actor on Tick(),
it happens the same, so it’s likely
not just BeginPlay() but the whole
first frame.

Here are you talking about moving some other actor or moving the InstancedStaticMeshComponent’s actor during tick? I thought you are talking about moving the InstancedStaticMeshComponent in Tick which causes its physics bodies to be moved too. But in this case I don’t think it would be doing deferred physics object creation because the InstancedStaticMeshComponent’s actor wouldn’t be Static if it’s able to be moved during Tick.

I can understand how deferring the
load of things like foliage can be
acceptable, but if you use ISMCs for
walls or for the ground, this
behaviour can totally break the game
so I think it should be optional,
ideally on a per component basis.

Agreed, we need to either guarantee the physics objects are created before BeginPlay or add a flag to allow you to prevent your components from getting deferred physics object creation.

Cheers

Here are you talking about moving some other actor or moving the InstancedStaticMeshComponent’s actor during tick?

I meant the other actor, the movable actor without ISMCs.

Please, if there’s any update on this, let me know. You guys really should make the bug tracker public.

I’ve submitted a fix for this which should be in 4.9

Thanks for catching this!

Yay! Thank you.

So the engine no longer defers the load or there’s a way to configure it now ?