Skip to content

Baking a NavigationMesh for HeightMapShape creates incorrect NavMesh #76195

@rustwork

Description

Godot version

4.0.2.stable

System information

Windows 10, Vulkan, Nvidia RTX 3060 Ti

Issue description

When baking a NavMesh from code for a StaticBody3D that has a HeightMapShape as its Shape, the resulting navmesh is offset and skewed strangely.

Here's a simple example where a radial gradient image is used to generate cone shaped collision for a HeightMapShape. As you can see the navmesh is offset and distorted compared to the collision.

radial

navmesh

Steps to reproduce

Please see the Minimal Repro project attached below.
When you run it, you can move the debug camera with WASD and rotate it by holding down the right mouse button.

The project is structured like this:

navmesh_proj

Note: The Parsed Geometry Type of the NavigationMesh is set to Static Colliders

The script on the root node generates collision from an image and then bakes the navmesh.

Minimal reproduction project

NavmeshBug.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions