Collisions of imported models

Greetings to all!
I imported the model of the house from the renderosity. Through daz3d I converted to fbx. Uploaded to playcanvas. Please tell me how to add collisions so that you can move around the house, and not along textures

Hi @Jest,

You need to add collision and rigidbody components to your model, and then they will collide with a physics based player controller.

Check this example on how that works:

https://developer.playcanvas.com/en/tutorials/third-person-controller/

I understand that, but how to add collisions and rigidbodies to all parts of house separately.

You have two options:

  1. Set the collision component to Mesh, and drag and drop your model there. That works with static bodies only and it will create an exact physical shape. Though if your model is high poly it can have a performance impact, or even not work at all (there is a memory limit on the physics engine).

  2. Create dummy entities that don’t have any model, only a collision and rigidbody component and try to approximate the collision shape yourself.

1 Like

Oh, thanks. Will try

@Jest, what i would do is use primitives for collision, with no model, just collision, then make the model just a model, no collisions, so you can see the model and have separate collision, and this could allow a secret room!(p.s, i suggest you create an entity to group the collisions together)

1 Like

You can also use compound collision shapes that have great performance and versatility:

https://playcanvas.github.io/#physics/compound-collision.html

Hi,
I’m trying to do the thing recommended by Leonidas

Set the collision component to Mesh, and drag and drop your model there. That works with static bodies only and it will create an exact physical shape.

But When I import my glb into the editor, it does not generate a Model asset. It only generates these 4 assets

I can’t drag and drop any of these in the Collision component (it is expecting a Model asset)
How can I generate a Model asset from my glb file ?

Thanks!

Hi @Benosse,

That’s ok, you can drag and drop your Render asset, below the Model asset there is a Render asset field:

image

1 Like

Of course :man_facepalming: sorry for the dumb question and thanks for the help!

1 Like