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

**URL:** <https://forums.unrealengine.com/t/collisions-doesnt-work-at-beginplay-against-instanced-meshes-if-their-mobility-is-static/323469>\
**Category:** World Creation\
**Tags:** beginplay, Instanced-Mesh, unreal-engine, Collision, bug-report, question\
**Created:** [June 29, 2015, 7:31pm UTC](https://forums.unrealengine.com/t/collisions-doesnt-work-at-beginplay-against-instanced-meshes-if-their-mobility-is-static/323469 "2015-06-29T19:31:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TS100101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TS100101](https://forums.unrealengine.com/u/TS100101)\
**Post date:** [June 29, 2015, 7:31pm UTC](https://forums.unrealengine.com/t/collisions-doesnt-work-at-beginplay-against-instanced-meshes-if-their-mobility-is-static/323469/1 "2015-06-29T19:31:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_550b73f9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_550b73f9](https://forums.unrealengine.com/u/anonymous_user_550b73f9)\
**Post date:** [July 1, 2015, 10:15am UTC](https://forums.unrealengine.com/t/collisions-doesnt-work-at-beginplay-against-instanced-meshes-if-their-mobility-is-static/323469/2 "2015-07-01T10:15:14Z")

</div>

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.

-

---

<div class="post-metadata">

**Author:** ![TS100101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TS100101](https://forums.unrealengine.com/u/TS100101)\
**Post date:** [July 1, 2015, 4:26pm UTC](https://forums.unrealengine.com/t/collisions-doesnt-work-at-beginplay-against-instanced-meshes-if-their-mobility-is-static/323469/3 "2015-07-01T16:26:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_550b73f9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_550b73f9](https://forums.unrealengine.com/u/anonymous_user_550b73f9)\
**Post date:** [July 2, 2015, 7:51am UTC](https://forums.unrealengine.com/t/collisions-doesnt-work-at-beginplay-against-instanced-meshes-if-their-mobility-is-static/323469/4 "2015-07-02T07:51:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TS100101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TS100101](https://forums.unrealengine.com/u/TS100101)\
**Post date:** [July 4, 2015, 6:10pm UTC](https://forums.unrealengine.com/t/collisions-doesnt-work-at-beginplay-against-instanced-meshes-if-their-mobility-is-static/323469/5 "2015-07-04T18:10:42Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![\_Epic\_Ori\_Cohen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_Epic\_Ori\_Cohen](https://forums.unrealengine.com/u/_Epic_Ori_Cohen)\
**Post date:** [July 6, 2015, 7:07pm UTC](https://forums.unrealengine.com/t/collisions-doesnt-work-at-beginplay-against-instanced-meshes-if-their-mobility-is-static/323469/6 "2015-07-06T19:07:01Z")

</div>

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

Thanks for catching this!

---

<div class="post-metadata">

**Author:** ![TS100101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TS100101](https://forums.unrealengine.com/u/TS100101)\
**Post date:** [July 8, 2015, 4:27pm UTC](https://forums.unrealengine.com/t/collisions-doesnt-work-at-beginplay-against-instanced-meshes-if-their-mobility-is-static/323469/7 "2015-07-08T16:27:27Z")

</div>

Yay! Thank you.

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