Even objects that do not have client authority set. I have several AI objects that spawn immediately upon starting the server or host. None of them should be under the authority of any client, and yet all of them call OnStartAuthority every time the server starts.
According to the documentation, this method should only be called on a client once the server dictates that it should have authority over a certain object. It should not be called on the server object:
The server usually has authority over everything, and seeing how a “host” is a client running on the server that gives that client authority over everything as well.
@EAVN There is a bug in the HLAPI in NetworkIdentity. In OnStartServer, authority is set to true for all objects that have the localPlayerAuthority flag set to true. That’s the little checkbox on NetworkIdentity that you MUST set to true, or otherwise you can never take authority over that object. From what I can tell, ForceAuthority is always called after this, so the authority would be set correctly anyway, so it should be safe to completely comment out the setting of that field in OnStartServer. I think that would prevent OnStartAuthority from running on all objects that have this set. If your objects have the localPlayerAuthority flag set, try turning that off if possible and see if the behavior is the same.