Server multiple scenes and scene physics raycasts

I love this asset, I just have one issue where my server has multiple stacked scenes, moving some npcs, each scene with separate physics system, so I have to duplicate AIBase and AIPath, replace Physics.Raycast with gameObject.scene.GetPhysicsScene().Raycast(). In an updated version I couldn’t fully do this as there were some static classes and I got a bit confused.

It would be so nice if we had this feature built-in in any upcoming version. Thank you!

2 Likes

Hey, did you find a solution?

Sadly no, I had to duplicate and modify myself, which is an ugly solution. It’s sad this got ignored, I guess this asset is not made with multiplayer in consideration

1 Like

Is there any solution for that? I love this asset but it’s incredible painful that I can’t just have more than one astarPath component active at the same time. For example im using it in a server, that has all the game scenes loaded (since its an mmorpg) and I can’t have 1 recast graph on each scene.

A workaround that I found that it’s feasible more or less is to load ALL SCENES in editor and do a gigantic recast. This works but the workflow is terrible

With unity navmesh, I would just bake a surface on each scene and that’s all

Hi

The FollowerEntity component has built-in support for this. There’s a PhysicsSceneRef on the entity it creates which specifies which physics scene to use for its simulations.

The recast graph now also has RecastGraph.collectionSettings.physicsScene

See CollectionSettings - A* Pathfinding Project

You must, however, set both of these via a script. They are not exposed in the inspector, and cannot be serialized in any case.

The NavmeshPrefab component is, however, able to scan the scene like a recast graph, and it will use whatever physics scene it is part of. See NavmeshPrefab - A* Pathfinding Project