Problem with Mirror Multiplayer

Client is not targetting the host and the host is always targeting the client. I am using the editor and build to test. When I connect as Host in the editor, the target variable of tank spawned by the host is only getting set, and not of the tank spawned as client.


My script is a little different than the one in course but similar. I skipped the CommandGiver script and using UnitMovement for this as well. And this update is the same as the one in Section 1s player controller.

I did tried commenting the [ClientCallback] and initial hasAuthority check but still same results.

Hi there, can you share your code for the RTSPlayer, specifically the unit event subscriptions.



RTSPlayer


UnitScript

Hi there,
On the client side, I can see that in OnStopClient(), the units are being subscribed to again instead of unsubscribed. Please change those “+” to “-”.
Not sure if this would have caused your problem, but best to fix it and see what happens.

Did that, but that didn`t fix the problem.

Okay, we should drop in some Debug statements and figure out where things are going wrong. Can you start by adding some to CmdSetTarget, see if that’s getting called?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms