Search Unity

Collisions with internal edges of mesh

Discussion in 'Physics' started by MightyNigel, Aug 7, 2019.

  1. MightyNigel

    MightyNigel

    Joined:
    Jun 25, 2019
    Posts:
    1
    Hi all,
    Think I really just need some help getting my head around what's happening here. I'm new to unity, this is my first project and is something of a learning curve. I'm making a simple mini golf game, and everything is fine when the ball is travelling on flat surfaces, but when I've got ramps in it's all going a bit weird.

    My mesh is created in sketchup where I've grouped everything, a single group for each hole's green surface, and a single group for each hole's boundary edges. I'm having issues where my ball is bouncing off the internal edges within my surface meshes... sometimes!

    Screen Shot 2019-08-07 at 11.41.53 (2).png

    Hole 2 for instance, has a simple ramp jump. No matter how fast I hit the ball, it will always run up this ramp. Hole 4 has a similar ramp, but if I hit it fast it hits the bottom of the ramp. Hitting it slowly it bumps over the bottom. But it's a single mesh, the ramp is part of the surface at the bottom. Not sure what would cause these to behave differently.

    On both holes if I hit the ball quick it will bounce off the top of the ramp, slowly it will go over as it should.

    And on hole 4 you can see there are actually three planes making up the ramp, the ball will NEVER bounce off the two middle edges, only the bottom and top!

    I'v done a lot of googling and understand a lot of people are getting issues with collisions between meshes causing the same issue, but can't find anyone having this issue when it's a single mesh with a single mesh collider attached.

    Just looking for some starting points to get an understanding of this if anyone has any suggestions. I've attached the screenshot from sketchup showing the two ramps, but appreciate people might need a lot more details so please tell me what will help diagnose this.

    I've tried changing Default Contact Offset and Fixed Timestep which were the two things suggested repeatedly for the collision between two meshes issue, but they didn't help so I'm guessing it's a mesh issue. Appreciate sketchup isn't the most flexible of tools out there but it's what I've got to hand

    Appreciate anyone pointing me in the right direction.
    Cheers,
    Si