Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Passing variables between functions

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

  1. tezer86


    Jul 19, 2010
    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.