I'm building a online game, and the players need to build the navmesh at runtime. I wanted to know if I can guarantee that the navmesh builded is the same for every player.
I wouldn't count on that, Unity has had a history of not providing the exact same results on different platforms and cores. Besides that, you're basically introducing client authority in your multiplayer game, something that you generally want to avoid and instead have your server be authorative. May I ask why you want to take this approach?
Thanks man, I want this approach because otherwise I would have to share constantly the position of the walking game objects over the scene. How do you recommend to share navmesh data in a multiplayer game runtime ?
Well if the game is multiplayer you will have to share and synchronize the positions regardless, else you won't see the other players moving. It'd be much safer to have your server have the NavMesh, have the players send in the destination they want to go (like by clicking on the floor), then have the server calculate the path and handle the movement after which the results get sent back to all the users. That's an example of server authority: the clients only process the player inputs while the server handles the game logic, then sends the results back to the clients. This will generally ensure all players stay in sync, as well as reduce cheating options.
Hi. How would the server have a navmesh?? Can't I just tell the server the localplayers current position for it to then send this to the other players? I'm not very concerned about cheating to be honest, its not a shooter game, its point and click.
You can definitely just share positions among players without server authority, if I'm not mistaken that is what the Network Transform component does. As for how the server has a Navmesh, normally speaking every build of your game will have a Navmesh since you bake those in the editor, then make your game build. Your server is basically running the same executable with different permissions.