Merge complex mesh

Hi there!

What I’m trying to achieve is: when I click on an object the player should find its path to the model (+ some distance so it doesn’t stop right on it).

I used a pathfinding library with simple Three.js boxes as placeholders, and everything worked fine. When I finally decided to swap these boxes with Blender models in .glb format, the pathfinding broke.

I found out the problem arises when dealing with complex models that have more than one mesh (note: not multiple objects, simply if a part of the model is not connected through vertices to the rest of the mesh). Even when using traverse or groups, the pathfinding struggles to determine where to go.

If anyone can suggest some workaround I’ll be extremely happy

Thanks in advance!

Often for these situations, you would make custom invisible simplified meshes+geometry for pathfinding to decouple it from the presentation. That way you can get the same/consistent behavior even if you need to swap out lower/higher res models for different spec targets.
Perhaps you can just use the cubes for your pathing?

1 Like

Thanks, that’s what I ended up doing. Just wish I could use the actual model.
I used 2 different raycasters, one for the movement on the navmesh and one for the invisible objects, and set one layer for the rendering and one for the clickable objs

1 Like