Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavigationObstacle3D no longer applies transform rotation to its vertices in 4.2 #85722

Closed
stechyo opened this issue Dec 3, 2023 · 4 comments · Fixed by #96730
Closed

NavigationObstacle3D no longer applies transform rotation to its vertices in 4.2 #85722

stechyo opened this issue Dec 3, 2023 · 4 comments · Fixed by #96730

Comments

@stechyo
Copy link
Contributor

stechyo commented Dec 3, 2023

Godot version

4.2

System information

Linux

Issue description

It seems that navigation obstacle vertices no longer follow the transform rotation in 4.2. Not sure if this is a regression or intentional, if it's intentional I'd consider documenting it here. This is evidently visible on the gizmo, but given it affected the AI in a project I was working on I assume it doesn't only affect the gizmo.

Steps to reproduce

Open the minimal rep. project on 4.1 and then 4.2, or:

  • Create a NavigationObstacle3D with some vertices on Godot 4.1
  • Rotate it and check that the yellow vertex gizmo rotates
  • Save the scene
  • Open on 4.2
  • Rotation is no longer applied

Minimal reproduction project

godot-navobs-issue.zip

@smix8
Copy link
Contributor

smix8 commented Dec 3, 2023

The only thing that got changed is the debug display because it was displaying the wrong thing. #82593.

An avoidance obstacle has no full transform, it only has a position and the vertices relative to that position.

The late change from Node to Node3D brought with it that all the Node3D properties are inherited. So now users could suddenly rotate or scale the debug visuals by scaling the Node3D inherited part of the obstacle. The debug is rendered as a part of the node so all node changes affect it visually. The actual obstacle on the navigation server never did follow because it has no transform.

@stechyo
Copy link
Contributor Author

stechyo commented Dec 3, 2023

I see. Must be something else that's not working. Thanks.

@stechyo stechyo closed this as completed Dec 3, 2023
@smix8 smix8 added the archived label Dec 3, 2023
@tracefree
Copy link
Contributor

For anyone else running into this issue, here's a workaround: https://gist.github.com/tracefree/36fcd1aac7399a9d2ebf6aefc670f6d2

It seems like a strange limitation to me that obstacles can't be rotated. I add a NavigationObstacle3D as a child to scenes like chests that should affect navmesh baking, but in the current implementation there is no way to have that obstacle be affected by the parent transform. Could this issue be reopened?

@tracefree
Copy link
Contributor

tracefree commented Oct 17, 2024

@stechyo Hi, my PR #96730 should fix this. If you like you could give it a try and let me know if everything works as you'd expect it to with it?

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

Successfully merging a pull request may close this issue.

3 participants