Skip to content

NavigationServer2D agents confused with their 3D counterpart? #106250

Open
@Dan-The-Assassin

Description

@Dan-The-Assassin

Tested versions

  • Reproducible in: v4.3.stable.mono.official [77dcf97]

System information

Godot v4.3.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 32.0.15.6094) - 13th Gen Intel(R) Core(TM) i9-13900KF (32 Threads)

Issue description

I've attempted coding an avoidance agent through script, but the result is not the expected one. The NavigationServer2D agent produces the incorrect safe velocity, a Vector3 instead of a Vector2, where the y value is always 0 and the avoidance does not work at all.

Steps to reproduce

Create a CharacterBody2D. Then, create an agent in script through the NavigationServer2D functions, give it a callback for the safe velocity. In the physics process, give the agent a velocity. In the callback for safe velocity, give the CharacterBody2D the safe velocity. You'll notice the y will always be 0. If the vector is instead made a Vector3, you'll notice the z has a value. Giving the velocity's y the safe velocity's z value seems to make movement work as intended, except for the avoidance which simply doesn't work.

Minimal reproduction project (MRP)

testproject.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions