Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

How to create and move a hole at runtime on a simple quad terrain?

Discussion in 'Physics' started by dacohen, Aug 8, 2018.

  1. dacohen

    dacohen

    Joined:
    Apr 29, 2016
    Posts:
    1
    Hi. I'm having issues about how to create a hole and move it during runtime. The Physics should behave accordingly: if the hole moves below to an object, that object is expected to fall.
    Anyone here with experience knows how to give a good advice on this case?
    Thanks in advance!
     
  2. BoogieD

    BoogieD

    Joined:
    Jun 8, 2016
    Posts:
    202
    You could find the closest vertex in the mesh from mouse pointer etc. then find the associated vertices that define the edges of where the hole is supposed to be and alter their values so a hole is rendered. When the hole moves, the original height coordinates where the hole was last rendered will have to be reassigned so it ends up as it originally was.

    https://docs.unity3d.com/ScriptReference/Mesh.html