Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Planet Gravitational Collision On Surface

Discussion in 'Physics' started by Electro007, May 18, 2020.

  1. Electro007

    Electro007

    Joined:
    Jan 10, 2020
    Posts:
    1
    I'm making a Super Mario Galaxy gravitational system.
    For a planetoid, it works by creating 6 face of a cube then 'inflate' it to a sphere. Works great and allow me to use polybrush or noise generator for surface.

    I'm using a raycast under the player to get the normal vector of where the hitpoint land and then i'm applying the rotation to the player. Work like a charm.

    The problem come from the collision. If the planet have a bump, or is not a normal shaped sphere, mesh collide is useless do to the fact that the colision mesh go trough like this :

    upload_2020-5-18_12-52-7.png

    And it also seem that raycast is using the collider as detection, making less transition between angle less smooth (lower tri count) but whatever for now. Also note that the sphere collider wont work for rotation cause it's only one face.

    Link to a great ressource with better explanation : link

    I don't know how to tackle the problem of colision.