Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Climbing vertically?

Discussion in 'Navigation' started by herra_lehtiniemi, Mar 9, 2023.

  1. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    I’m dynamically generating buildings and I want my player and enemies to be able to climb the walls. How would I go about this? I’ve seen videos about first baking and then rotating the navmesh to achieve this, but I’m creating the objects run-time so I can’t bake them in editor. Also the agent only has an option for maximum 60 degrees slope. Is there a way to achieve this without coding it outside navmesh?
     
  2. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,989
    https://learn.unity.com/tutorial/runtime-navmesh-generation
     
  3. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    Thank you for the suggestion. But that's the approach I mentioned that requires baking beforehand. I'm building the objects from pieces dynamically run-time so I can't do the bake + manual rotation approach.
     
  4. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,989
    It's in the title: "runtime". It is not mesh baking beforehand, it's during runtime.
     
    Last edited: Mar 10, 2023
  5. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,989
    In case the old Unity tutorial isn't enough to figure out how to build navmesh runtime, here is another series touching the subject:
     
  6. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    I appreciate the answers, but the first video doesn’t show how to generate vertical navmesh in runtime. The video does it by duplicating a pre-baked navmesh and rotating it. I don’t know why the title talks about runtime. The problem isn’t that I can’t generate a navmesh runtime. It’s generating a vertical navmesh runtime. Let’s say I build a wall from cubes (runtime) and when the wall is done, I want a navmesh onto that wall so I can walk it. What approach would work to this? The NavMeshSurface component seems to use world up to generate the mesh so it would generate the mesh on TOP of the wall. It might work if I generate this wall sideways and rotate it when the mesh is built, but it gets complicated if the wall has four sides I would have to bake runtime before I can rotate it upwards.