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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Sending and Receiving rpcs/commands on a scene object?

Discussion in 'Multiplayer' started by Leoo, Jul 16, 2015.

  1. Leoo

    Leoo

    Joined:
    May 13, 2013
    Posts:
    96
    Hello everyone!

    Going from Raknet to the new Networking System, came to a point where i need some advice.

    I have several GameObjects in my scene that work as managers, one called like : "ResourceManager" that have a list of 'resources GO' and some other information, when i am the server, my resourcemanager makes those resources depending on needs and choose prefabs and such, if you are the client then resourcemanager asks the server the resource list so it can instantiate those in their good position, rotation, and keeps the list updated when the client or server ask to destroy or build a new one.

    Since the rpcs/commands can only be sent from "local authority" objects, that means this "manager" aproach is not suitable on unet?.

    Am sure this is mainstream easy, but wanted to know what is the best solution talking about asking server stuff about the scene in my example.

    Thanks for your time and advice!
     
  2. peterept2

    peterept2

    Joined:
    Aug 1, 2012
    Posts:
    41
    You could skip cmd/Rpc and use network messages directly for the manager because it sounds like you may want that indepenant of the layer (local authority) anyway?

    Alternative in the unity beta's it now let's the server assign local authority to multiple game objects. So if you have a pro license you could get the beta and do it.
     
  3. Leoo

    Leoo

    Joined:
    May 13, 2013
    Posts:
    96
    Indeed i need that type of control independant of that layer , is that possible? so using network messages insdead of cmd/rpc ? didnt know i could do that. Local authority is something i want to stay away from.