Search Unity

Character bump into terrain and jumps a little

Discussion in 'Physics' started by Baxtrax, Jun 1, 2019.

  1. Baxtrax

    Baxtrax

    Joined:
    Jun 1, 2019
    Posts:
    2
    The problem I have is that my game is voxel based, so the terrain is very blocky and not smooth, unlike normal terrain. The problem comes when the character/player will hit an "edge" of the terrain and jumps (I assume due to the capsule collision box) Is there a way of fixing this?

    Here is a visual representation of the problem:
    Problem:


    What I want to happen is once the player hits the ledge, they should pop up or smoothly transition to the next height. Most of this could because of how I am using collision boxes. For reference the character is using Capsule Collision while the ground is using Mesh Collision, hence why its collision is very blocky.

    I am new to Unity and want to learn how to do things the CORRECT way. So if anyone knows how to fix this, please help me!

    Thank you for your time :)
     
  2. Baxtrax

    Baxtrax

    Joined:
    Jun 1, 2019
    Posts:
    2
    Update: I was able to fix collision by separating the ground into "chunks" and using the convex option for the collision. With this way, you smooth out the inclines/declines, but with better resolution. If you want even more resolution, make the chunks smaller.