Mesh collision with strange clipping

(Launch: PlayCanvas | HTML5 Game Engine) Hello, I made a simple terrain model but there are a few issues with it, 1. The mesh has collision & rigidbody, but the player clips into it at certain edges. 2. I noticed sometimes in certain vertex areas, the mesh looks like it “pulls” to player into it for lack of better words, so I am not sure if it is just the model (.obj, made in blockbench) Or the editor mesh system is disfunctional, or I have done something wrong in the editor on my part? Here is an image of the player clipped into the model:

The editor is here: PlayCanvas | HTML5 Game Engine

For a visual diagram, this should help.

It’s the areas like this are what are effected:

here I added a tree mesh (with collision and static rigidbody) at one of the intersecting vertex areas in the terrain mesh, but- it doesn’t have collision and the player con phase through it as well as the model face the tree is on. So I think the issue might not be the mesh but maybe how collisions are applied to it which gives it this weird bug. Anyone have any ideas to fix this?

Hi, you may find some help in this thread.

Also, you can try setContactProcessingThreshold to see if this still happens.

1 Like

I think the first one related to my issue best, but I read the user manual for ammo.js and it doesn’t really have much information on the primitive to mesh collision issue, I read that it could be the large triangles (Which is the style, low - poly) So I think I could just break the effected faces apart and make a few faces there instead of just a single large triangle face correct?

I removed the face here, and renewed it as 2, I can test this and see if it works. Thanks for the links for my issue, I appreciate your help.

1 Like

Okay so the vertecies in the corners were in fact the issue, I gathered the info from the links you provided and made the corners doubled but this didn’t work (I found out this is because the triangle meshes were much too small, so I had the double all the terrain triangles to keep it less streched for all the faces)

Now it works much better, with 0 issues on collision:

1 Like

Whenever you have issues with collision, I recommend using a debug drawer. I have a little tool that can help with it here:

https://playcanvas.com/project/744419/overview/ammo-debug-draw

Steven also has a booklet, which allows you to use that tool without adding it to project:

1 Like

Very nice! Looks great, and I do appreciate the help! thanks to all who helped with the issue, and I do appreciate this tool (it will be very helpful)

Sorry to break in, but does it mean the mesh of the rock on the picture does not have the correct scaling or something?

Nevermind, it meanst the collision component has a bigger scale.

Right, the rock collider size does not match the visual mesh. I will leave it to the author to decide if it is intentional.

2 Likes

Yeah so, I noticed this as well, but it isn’t very visible in game without the outline for the collision, and doesn’t mess anything up for testing purposes. I think the reason is because I have the mesh scaled higher to combat the big triangle pols so in the outline it’s bigger but as the player there’s no difference besides not clipping.