Hi everyone,
Right now I am working on multiplayer game project, where a players can interact with AI in different ways, while AI have different routines of different type with corresponding animation. In single player everything is working correctly, but in multiplayer it is not, as I have already got it. My problem is that I can’t come up with proper way to sync call NavMeshAgent.SetDestination(). On top of that, once AI reaches particular point, it is supposed to play an animation using Animator, which also may call different methods. So, does anyone can suggest or recommend a solution or a logic? I am really struggling like the whole week:(
Thanks in advance.
EDIT: I found a way. If someone will be asking, play around with SyncEvent.
I am not sure what you mean by sync the navmesh, usually all ai is run on the server.
Yes, I know, AI moves and do everything expected on server, but on client first of all it is not active, secondly doesn’t move. Even when I am using [ClientRpc] attribute on method, which calls SetDestination(). Also, if it helps, on network identity field “Server only” is checked.
Server only literally means only work on server, I do not know why that option exists.
I just noticed, this is why it is disabled on clients. However, it doesn’t move on clients, only on server. Maybe, someone have an example of implementing SyncEvent for AI? As I have read, this will let call method on server and on client.
Did you put a network transform on it?
em, no. I mean, why? It is just gonna teleport.
I guess you could use rpc if you want no interpolation, bit confused about what you want to do.