Collision problems with scale

Hi,

I am having a lot of problems with the collision detection.

If I instatiate a 3D model and I translate or rotate it, the collider seems to match the model and I am able to detect the collision. So far, so good…

However, if I scale the model (by modifying the entity scale property), the collision detection begins to fail. It is as if the collision component is not properly managed when there is a scale.

All the problems I refer to, appear when I do these operations in a script. Within the editor, the collision seems to work properly even with the scale operation.

However, if I use a primitive (box, sphere, etc.) the collision component is not updated if I scale the entity. Even, within the editor, you need to modify the collision component to match the scaled primitive shape. This does not make sense to me.

For instance, if I create a sphere primitive, it can be scaled differently in each of the 3 axes, but the collision component cannot longer match the shape because it only has a radius property.

Can someone explain to me how to treat the collisions, especially with 3D models. I could live with the primitive problem but I need to make the collision component work with 3D models and the scale operation.

Thanks in advance.

Bullet physics works only with primitives and meshes.
So, sphere has only radius to change, box has thee dimensions.

Your entity consists of two components - your physical primitive and your visible mesh. It you scale your visible mesh it doesn’t affect on your physical body. So you have to scale it too. But, as you can see, its not such easy.

Physics-based render can place your mesh on physic-body position, but scaling is not the same.

I can be wrong, so probably somebody more experienced will help you.

Also. I’ve done a nice script to use compound shapes, if you need it.

I know this is a pretty old thread, but have you solved this @Sergio_Casas ?

Hi @joshb! Can you please create a new topic with your problem and an editor link of your project?