Move only my unit using RPC

I have a click-to-move script and when 2 or more players joined, if one of them clicks the map, other players's units move too, how can i do so he moves only his character and im moving only mine and so on... I will leave the scripts bellow. <- script to get the movement <- script to send the movement.


  • Hi @LokiOfJotunheim,

    before sending the RPC you should check the isMine condition of the PhotonView component. You basically should do this before any Input is processed. In your case it should look similar to the following:
    void Update()
        if (!photonView.isMine)
        // Do something
        // In your case: check MouseButton and send RPC (if click is valid)
Sign In or Register to comment.