# Only the first 128 instances of an instanced static mesh have collision when spawned in a blueprint

**URL:** <https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291>\
**Category:** Asset Creation\
**Tags:** unreal-engine, Instanced-Mesh, bug-report, Blueprint, question\
**Created:** [October 4, 2014, 9:41pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291 "2014-10-04T21:41:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hyperloop](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hyperloop/32/1203427_2.png) [@Hyperloop](https://forums.unrealengine.com/u/Hyperloop)\
**Post date:** [October 4, 2014, 9:41pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/1 "2014-10-04T21:41:08Z")

</div>

Running 4.4.3, Win7.

I’m spawning instanced static meshes via an actor blueprint using the “AddInstanceWorldSpace” function, and once I reach 128 of them, no subsequent instances spawned in that blueprint actor have collision. They do not collide with the player, nor do they generate trace events.

~I’ve tested this both with using simple collision as complex, and also with simple collision boxes.

~I’ve confirmed that once you hit the 128 limit, you can spawn a _different_ set of instanced meshes within the blueprint and they will have collision for the first 128 copies.

~The issue does not exist if you set the instanced mesh to be static and not movable.

This is severely limiting the usefulness of instances, because you can’t manage or delete them unless you can get a ref to them by tracing.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [October 6, 2014, 6:12pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/2 "2014-10-06T18:12:42Z")

</div>

Hi ,

Does this occur on a blank project with no additional content? How are you spawning them in (dynamic, manually placed, etc.)?

---

<div class="post-metadata">

**Author:** ![Hyperloop](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hyperloop/32/1203427_2.png) [@Hyperloop](https://forums.unrealengine.com/u/Hyperloop)\
**Post date:** [October 6, 2014, 8:48pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/3 "2014-10-06T20:48:28Z")

</div>

- I wasn’t aware that you could manually place Instanced meshes outside a blueprint? Is that possible??

Anyway, in terms of if it happens in a black project with no other content: yes, it does happen.

Here’s the error message from the console that may be related:

" LogPhysics:Warning: PHYSX: …..\LowLevel\software\src\PxsAABBManager.cpp (541) 32 : A PxAggregate has exceeded the limit of 128 PxShapes. Not all shapes of the aggregate will be added to the broapdhase

LogPhysics:Warning: PHYSX: …..\SimulationController\src\framework\ScElement.cpp (112) 32 : Unable to create broadphase entity because only 32768 shapes are supported"

This error only seems to pop up after the 42’nd instance is created for me though.

Regardless, the 128 instance limit on collision for movable meshes seems to be predictable and reproducible across projects for me.

Here’s the pastebin of my node setup, in case you want to test it out yourself (you’ll have to replace a couple variables though)

The 129’th block on the end of the row won’t have collision.

[http://pastebin.com/raw.php?i=0P6SmKwR](http://pastebin.com/raw.php?i=0P6SmKwR)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [October 6, 2014, 9:15pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/4 "2014-10-06T21:15:14Z")

</div>

Ah I missed the “instanced” in the description, my mistake! Are you calling these in the construction script?

---

<div class="post-metadata">

**Author:** ![Hyperloop](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hyperloop/32/1203427_2.png) [@Hyperloop](https://forums.unrealengine.com/u/Hyperloop)\
**Post date:** [October 6, 2014, 9:37pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/5 "2014-10-06T21:37:39Z")

</div>

I’ve tested calling them both in the event and construction scripts, the behavior is the same.

Here’s the quick and dirty node setup:

 ![17150-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/1/6b18a9c19b2c4f29e327d63dce8305babc8cade2.jpeg)

---

<div class="post-metadata">

**Author:** ![Ruffian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ruffian](https://forums.unrealengine.com/u/Ruffian)\
**Post date:** [October 7, 2014, 3:19am UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/6 "2014-10-07T03:19:15Z")

</div>

I just came upon this problem trying to loop thru all the instances in a InstancedStaticMeshComponent. When hitting the 129 instance in the loop (index 128), it crashes. Mine component was set to Movable, and this is fixed when setting to Static as you said, but I’m curious why that’s happening also.

---

<div class="post-metadata">

**Author:** ![Hyperloop](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hyperloop/32/1203427_2.png) [@Hyperloop](https://forums.unrealengine.com/u/Hyperloop)\
**Post date:** [October 7, 2014, 3:29am UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/7 "2014-10-07T03:29:23Z")

</div>

Can confirm that when setting it to static it is fixed. This does make instances of limited usefulness however since it would be nice to be able to move them on many occasions.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [October 7, 2014, 5:51pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/8 "2014-10-07T17:51:26Z")

</div>

Hi ,

I have been able to reproduce this effect on my end and have entered a bug report, ttp#348924 to be assessed by the development staff. For now, please use static meshes instead of instanced static meshes until we can get to the root of this bug. Thank you!

---

<div class="post-metadata">

**Author:** ![Ruffian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ruffian](https://forums.unrealengine.com/u/Ruffian)\
**Post date:** [October 22, 2014, 9:58pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/9 "2014-10-22T21:58:26Z")

</div>

Is there any public way to check the status of these bug reports? I just tried testing again in 4.5 and it still crashes.

Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [October 23, 2014, 6:00pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/10 "2014-10-23T18:00:40Z")

</div>

Hi ,

Currently we do not have a public location where users can check into the status of bugs.

---

<div class="post-metadata">

**Author:** ![Ruffian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ruffian](https://forums.unrealengine.com/u/Ruffian)\
**Post date:** [October 28, 2014, 8:50am UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/11 "2014-10-28T08:50:53Z")

</div>

I have one more question about speed… I have a simple grid of these instanced static meshes, all updating positions every tick with [UpdateInstanceTransform][1], simply oscillating their Z-values. I did some profiling because you can see in the screenshot below, the frame time when the grid is 41x41 squares is pretty extreme. The profiler says the rest of the app is basically waiting for the “Phys SetBodyTransform” to finish, which takes ~50ms every frame, and is called 1681 (i.e., 41x41) times. I was wondering if it’s a bug that it’s this slow of a call, or if it really is just gonna take that long to update that many instances.

[](https://i.imgur.com/DciAIAS.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [October 28, 2014, 2:50pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/12 "2014-10-28T14:50:17Z")

</div>

Hi ,

A lot of that lag will have to do with your hardware, but otherwise it is going to be fairly normal for it to take a bit more time with that many instances being spawned at the same.

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [April 29, 2015, 8:53pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/13 "2015-04-29T20:53:45Z")

</div>

Hi , this bug is still in 4.7.6 ☹

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [April 29, 2015, 9:33pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/14 "2015-04-29T21:33:55Z")

</div>

If it is appearing again it may be a regression. I will try to reproduce this on my end tomorrow and see what I find. Thank you for the update.

---

<div class="post-metadata">

**Author:** ![Hyperloop](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hyperloop/32/1203427_2.png) [@Hyperloop](https://forums.unrealengine.com/u/Hyperloop)\
**Post date:** [April 29, 2015, 10:13pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/15 "2015-04-29T22:13:50Z")

</div>

Thank you for staying on top of this, it would limit the usefulness of instanced meshes severely if we can’t track this down.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [May 1, 2015, 3:36pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/16 "2015-05-01T15:36:19Z")

</div>

How many instances are you spawning at one time when this occurs? I just attempted an instanced mesh blueprint with 500 actors in it and all had collision as intended. Do you have repro steps I can take to reproduce this on my end?

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [May 1, 2015, 3:48pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/17 "2015-05-01T15:48:05Z")

</div>

You tried an instanced mesh blueprints with 500 Actors in it? I don’t really get what you say, do you call Instances “Actors”?

Just create an Blueprint, add an Instanced Static Mesh Component (I use the Hierarchical Instanced Static Mesh Component) and add 500 Instances. Once you exceed 128 instances your output log will get spammed with the PhysX Warning.

---

<div class="post-metadata">

**Author:** ![Hyperloop](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hyperloop/32/1203427_2.png) [@Hyperloop](https://forums.unrealengine.com/u/Hyperloop)\
**Post date:** [May 1, 2015, 3:53pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/18 "2015-05-01T15:53:38Z")

</div>

, I posted a screen cap of one possible node setup you can use to repro this higher up in the thread.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b9532c9a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b9532c9a](https://forums.unrealengine.com/u/anonymous_user_b9532c9a)\
**Post date:** [May 1, 2015, 4:48pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/19 "2015-05-01T16:48:38Z")

</div>

I apologize, I used incorrect terminology. I did mean to say instanced meshes. Here is the setup I used:

 ![40959-instancedmesh.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/d/6/2d662319ba24449d3db6967d009e51b48b845933.png)

I attempted this with the Hierarchical Instanced Mesh Component as well and received the same results. Collision worked on all objects and no errors appeared in the Output log. Are you using a specific mesh that is creating this error or does this occur in a new, blank project with base assets?

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [May 1, 2015, 4:52pm UTC](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291/20 "2015-05-01T16:52:08Z")

</div>

I used the tree from the kite demo for my tests, did your mesh had collision set up?

[Next page](https://forums.unrealengine.com/t/only-the-first-128-instances-of-an-instanced-static-mesh-have-collision-when-spawned-in-a-blueprint/295291.md?page=2)
