1 year ago

#352439

test-img

amir rahmani

How to make a networked enemy in unity and mirror

I'm making a multiplayer game and for kind of all of it I need to have enemies and AI characters.

-for example 5-10 players in a match fighting a monster together. and the monster needs to be synced for all clients.

-or when there are not enough players online the server would add AI bots to the match so the player wouldn't get board.

I tried to make the AI and spawn it and give its authority to one of the players so the AI calculation doesn't cost the server.

Even though I couldn't have the server-side AI because Match Interest Management and that wasn't possible by that.

The problem starts when for example 2 players join a 4-player match and server adds 2 more bots everything works fine until when the match starts the first player which controls the AIs is fine but the other player gets freeze. I look for any infinite loops in my codes but I didn't find anything. I tried delaying spawns but still nothing.

The freezing happens when I use the dedicated server. in the editor and local network there is a very low chance it would happen.

if anyone knows Mirror Please help me if you think you can.

Thank You. Sorry if I didn't explained well.

unity-game-engine

networking

unity-networking

unity3d-mirror

0 Answers

Your Answer

Accepted video resources