Logic behind making the master client control an AI?
I'm wanting to know how I'd go about making the master client control an AI within my game, especially one that is using state machines for the specific states of the AI.
How would I go about basically switching states of the AI, and then having the regular users know that the AI has changed states. Is it just using RPC's? I'm wanting to limit hacking as much as possible, so basically making sure a regular user does NOT control the AI nav agent.
My way, in my head, at least, would be this:
if (!view.IsMine) agent.enabled = false;
if (view.IsMine) // change states here
However, I know that I'd have to do a RPC check when a state has been changed so the other players know, but how would I go about doing that, especially if the non-hosts have the nav agent as enabled = false? Would the AI still be shown as moving if the agent is disabled from the non-hosts?