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

Placing "fake" hole prefabs in 3D level

Discussion in 'Editor & General Support' started by patrickk2, Jan 25, 2020.

  1. patrickk2

    patrickk2

    Joined:
    Dec 8, 2019
    Posts:
    92
    Hello everyone!

    I hope this forum is appropriate for my question, if not I would appreciate any pointers to better suiting forums.

    I am currently working on a 3D ball run game, and during level design I would like to be able to just place "(fake) hole" prefabs on the ground, instead of creating ground elements with actual holes in their meshes (mainly because the latter process would be way to time consuming, considering that there will be lots of holes).

    Is there a way to make it look like the ball falls though such a fake whole (the camera position would be fixed if that helps)? Unfortunatelly I am not sure where to start attacking this issue, so any ideas on how to do this or pointers to similar behaviour which could be adapted for my case would be greatly appreciated.

    Thanks in advance for any input you guys have on this issue!

    Best regards,
    Patrick

    P.S.: Sorry for the cross post, I am really not sure where this would fit best.
     
  2. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    223
    You could make circle sprites with circle colliders on them (trigger). Then put OnTriggerStay on the collides that will disable the balls collider. Not sure what you're doing exactly so idk if you are supposed to lose sight of the ball when it falls through if it drops to another level. Honestly though it probably be a lot more efficient for your game to just bite the bullet and cut the holes in your object. No code vs code
     
  3. patrickk2

    patrickk2

    Joined:
    Dec 8, 2019
    Posts:
    92
    Hello @knobblez!

    Thanks for your answer, and sorry for my delayed response! The solution I am trying now goes in that direction direction (together with some Shader tricks to make the fake holes look like real ones).

    The reason I would prefer "fake" holes, is that during level design, I want the holes to be freely placeable and movable.

    Thanks again for your input, and best regards,
    Patrick