stride3d / stride

Stride Game Engine (formerly Xenko)
https://stride3d.net
MIT License
6.32k stars 916 forks source link

Nagivation doesnt work with static meshes #2326

Open YerkoAndrei opened 1 week ago

YerkoAndrei commented 1 week ago

Release Type: Official Release

Version: 4.2.0.2149

Platform(s): Windows

Describe the bug Nagivation mesh ignore all static meshes

To Reproduce Steps to reproduce the behavior:

  1. Create new project
  2. Add simple navigation configuration as in the official tutorial
  3. Add a plane and some cube
  4. Add static colliders for both
  5. Add infinite mesh to plane
  6. On collider shapes of the cube, add static mesh and reference itself

Expected behavior Navigation mesh should update and use the cube as a wall or obstacle

Screenshots With static mesh 1

With cube shape (how it should look) 2

Additional context

Doprez commented 1 week ago

If you enlarge the box does the mesh still work with the surface of the mesh? Im curious because I know I used a static mesh at one point for terrain on the old recast nav mesh and it worked for that at least.

YerkoAndrei commented 1 week ago

Nope, i cant make it work, i have tried with fbx and glb, so its not that.

Im looking the code and the ColliderShape of the StaticCollider is alway null when using a StaticMesh. I think thats the problem. When the PhysicsComponent try to ComposeShape, it call CreateShape with a null service, wich is only used by Asset and StaticMesh (just these 2 fails). I dont undestand yet what is an EntityManager and why is null, so if someone know someting related please help.

Doprez commented 2 days ago

I should be able to look into this a bit this week. The file type should not matter so long as the collider is created, it uses the information from Bullet to create the nav mesh.

Can you also try to downgrade your project to 4.2.0.2122? Im wondering if one of the PRs may have had a larger affect than intended. https://github.com/stride3d/stride/pull/2262

YerkoAndrei commented 1 day ago

tried 4.2.0.2188, 4.2.0.2149, 4.2.0.2122 and 4.2.0.2042, not working on any