Search Unity

Passing variables between functions

Discussion in 'Multiplayer' started by tezer86, Jul 21, 2014.

  1. tezer86

    tezer86

    Joined:
    Jul 19, 2010
    Posts:
    90
    Hey All,

    Im having issues sending a simple String using an RPC, here is what I'm trying to do.

    I have both client and server with var mainTarget : String. Either the server or the client can send an RPC containing a different var mainTarget : String to another Client/Server. The issue I get is that when the message gets received it doesn't seem to update the String on the recipients game.

    So the question is: Why is the recipients local mainTarget : String not getting updated. Does it not automatically update recipients variable of the same name when an RPC sent via and RPC.

    Do I need to send the value via a different variable and then change the local variable manually.

    I hope that all makes sense, its a difficult question to write.


    Cheers