[SOLVED]Collision not working on cloned entity

Hello, i have an entity (static) with rigidbody(static too) and collision component, i clone it with the following code

                        var cwall = this.wall.clone();
                        cwall.enabled = true;

but the player keep on passing through the wall, the same code works well for houses, can’t understand why

Are you using any scaling?
If you just add the wall in the scene via the editor, do you still pass through it?

Yes @yaustar just checked, i pass through also in the original wall enabled in the editor :frowning: how is that? and yes i scale it 51,51,25

The physics rigid body is separate from the entity scale. So you have to resize the rigid body based on the how big the model is in the world.

1 Like

uh? how do i do that? edIt: the collision component is mesh, move it to a child and use the box i can scale it easy, but this line don’t work cwall.rigidbody.teleport(this.build[i].x,this.build[i].y,this.build[i].z);

Ok solved, changed the collision component to box in the main entity (luckly they matched enough) and it’s all ok. Unless a way to rescale the mesh collision too wouldn’t be bad. Thanks @yaustar.