# Spawning \> 3 copies of a prefab with a Physics Collider crashes Application

**URL:** <https://forum.8thwall.com/t/spawning-3-copies-of-a-prefab-with-a-physics-collider-crashes-application/7676>\
**Category:** Technical Support\
**Tags:** bug\
**Created:** [July 20, 2025, 7:22am UTC](https://forum.8thwall.com/t/spawning-3-copies-of-a-prefab-with-a-physics-collider-crashes-application/7676 "2025-07-20T07:22:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack\_Haehl](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@Jack\_Haehl](https://forum.8thwall.com/u/Jack_Haehl)\
**Post date:** [July 20, 2025, 7:22am UTC](https://forum.8thwall.com/t/spawning-3-copies-of-a-prefab-with-a-physics-collider-crashes-application/7676/1 "2025-07-20T07:22:42Z")

</div>

Upon trying to run the following code, spawning a prefab that contained nothing more than a blank plane and a Physics Collider (Static or Dynamic), I was met with an error:

```
for (let i: number = 0; i < 10; i++) {
  const originX = Math.random() * 3
  const originY = Math.random() * 3
  const originZ = Math.random() * 3
  const newPlane = world.createEntity(prefab)
  world.setPosition(newPlane, originX, originY, originZ)
}

```

Returns the following Error:  
▼ Uncaught RuntimeError: null function or function signature mismatch  
at syncWorldToPhysics(ecs\_world\_t\*, PhysicsContext\*) 00413022:wasm-function[106]:0x7627  
at stepPhysics(ecs\_world\_t\*, PhysicsContext\*, float) 00413022:wasm-function[112]:0x887d  
at c8EmAsm\_progressWorld 00413022:wasm-function[28]:0x21a2  
at Object. runtime.js  
at k runtime.js  
at F runtime.js  
at Object.tick runtime.js  
at r runtime.js  
at (anonymous) runtime.js  
at e runtime.js

However, if I instead take the collider off of the prefab, and create it when I spawn the entity as so:  
for (let i: number = 0; i \< 10; i++) {  
const originX = Math.random() \* 3  
const originY = Math.random() \* 3  
const originZ = Math.random() \* 3  
const newPlane = world.createEntity(prefab)  
world.setPosition(newPlane, originX, originY, originZ)  
ecs.Collider.set(world, newPlane, {  
shape: ecs.ColliderShape.Box,  
width: 1,  
height: 1,  
depth: 0.1,  
mass: 1,  
friction: 0.5,  
restitution: 0.5,  
linearDamping: 0,  
angularDamping: 0,  
rollingFriction: 0.1,  
spinningFriction: 0.1,  
})  
}

I no longer get an error.

I’m guessing this is a bug, so I’m making it known 👍

---

<div class="post-metadata">

**Author:** ![Jack\_Haehl](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@Jack\_Haehl](https://forum.8thwall.com/u/Jack_Haehl)\
**Post date:** [July 20, 2025, 7:23am UTC](https://forum.8thwall.com/t/spawning-3-copies-of-a-prefab-with-a-physics-collider-crashes-application/7676/2 "2025-07-20T07:23:56Z")

</div>

Oh I forgot to mention that if the for loop runs for 1, 2, or 3 iterations the error does not appear, it is only after i = 4 that this happens.  
It also does not have anything to do with all of these entities being spawned on the same frame, as I tried to space them out with a timeout and was met with the same result.

---

<div class="post-metadata">

**Author:** ![GeorgeButler](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/georgebutler/32/1903_2.png) [@GeorgeButler](https://forum.8thwall.com/u/GeorgeButler)\
**Post date:** [July 22, 2025, 4:55pm UTC](https://forum.8thwall.com/t/spawning-3-copies-of-a-prefab-with-a-physics-collider-crashes-application/7676/3 "2025-07-22T16:55:13Z")

</div>

I’ll take a look at this now.
