Search Unity

How to connect small mesh to larger one

Discussion in 'Scripting' started by DivergentGames, Oct 22, 2020.

  1. DivergentGames

    DivergentGames

    Joined:
    Apr 13, 2020
    Posts:
    5
    Hello, I am trying to make code for "digging" in a game I am working on. I have spent quite a long time trying to get it to work with limited success. The way I am trying to achieve this is by creating an inverted sphere, destroying the triangles on this sphere outside of the main mesh, clearing a hole in the main mesh, then connecting the semi-sphere back to the main mesh. You can see the way it looks when all but that last step is complete in the image linked below:
    https://imgur.com/a/sagw4OZ

    I have attempted methods of patching in that gap, but I have not yet found one which works correctly. One such attempt can be seen at the image linked below:
    https://imgur.com/a/36Z6zFq

    If anybody knows an effective method of fixing this issue, that would be great. Thanks!
     
  2. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
  3. DivergentGames

    DivergentGames

    Joined:
    Apr 13, 2020
    Posts:
    5
    I appreciate it, and that would certainly work under normal circumstances, but I'm not sure that it would be able to work in my game simply due to the way that I've structured the data for the world and its mesh. I'll try to look through the source code and find if I can apply the method they used to my game.
     
    adamgolden likes this.
  4. DivergentGames

    DivergentGames

    Joined:
    Apr 13, 2020
    Posts:
    5
    I tried to implement it into the game and it had some errors and also just took an excruciatingly long time to execute. The code I currently have can run in about 0.1 seconds, whereas this code took around 30 seconds on a very small planet. I appreciate the effort but I don't think it will work. I am more just looking for a method which will work to connect the two meshes.