[SOLVED] Cannot create Mesh Collision for GLB from Sketchfab – only Render Asset

Hi everyone!

I’m trying to create a collision for a building from Act 1 in my PlayCanvas project.
I imported the model from Sketchfab as a GLB file.

The problem is: after importing, only a Render Asset is created.
There is no option to “Generate Model Asset”, so Mesh Collision does not work.
The model contains multiple parts (walls, supports, floor) in a single Entity.

I cannot upload external files (like FBX), because I must work entirely inside PlayCanvas.
Manually recreating the building with Box/Compound collisions would take a lot of time.

Could someone please advise how to create an accurate collision for such a model entirely inside PlayCanvas, without using external files?
Is it possible using the Render Asset, Compound Collision, or a script?

Additional info:

Hi @GAMEPIX and welcome!

It looks like you should use a rigidbody and a compound collision component on the parent entity, and then assign the individual meshes to the collision components of the child entities. You could probably script this process, but given the number of parts I would do it manually.

Be aware mesh to mesh collision is not supported.

1 Like

Is this the fastest method? And how to make detailed collision?

There are only 25 parts, correct? Or do you need to apply this to more models?

By the way, I just notice that the naming doesn’t match, which makes it a bit more difficult.

Actually, each object already contains all parts together.
For example, one object includes all the supports at once, not individual pieces.

Like on the photo:

Can you maybe share the editor link of the project so I can take a look?

https://playcanvas.com/project/1394660/overview/blank-project

Unfortunately, it seems that compound collision doesn’t support meshes. :sweat_smile:

So, is this possible to make detailed collision?

I’m not sure what the recommended approach is here.

The only thing I can think of is to give each part its own rigidbody.

You mentioned that this could probably be done with a script.

In the project below, I’ve already done this for you. I also fixed the entity names so they match the meshes. I hope it helps.

https://playcanvas.com/project/1395635/overview/hello-neighbor-house

1 Like

Thanks, but could you say how to copy this project PlayCanvas | HTML5 Game Engine.

1 Like

I think you can just copy the parent entity and past it into your hierarchy. Alternatively you can fork the project.

1 Like