Instantiate question

Options
i know it sounds like it defeats the purpose of networking, but is it possible to make a photonnetwork.instantiate object viewable by the player that created it.

my game instantiates a menu for each player to use in the game. however i dont want other players to see other players menus, if that makes sense.

Comments

  • dreamora
    Options
    Why do you use network instantiate in this case? A menu is likely a totally local thing and the only part of it potentially related to the network are the interactions with buttons and data fillings which would normally be handled through RPCs?
  • because when my rpcs werent working through normal instantiate i asked in a topic called 'RPC Question' and quoting from there:
    sorry i added a photonview to the ngui button that i have this script attached. i also attached the enterbutton script to the "Observe" variable area in the inspector. now i get two errors:

    Illegal view ID:0 method: AddChat GO:EnterButton, and
    Received RPC "AddChat" for viewID 0 but this PhotonView does not exist!

    any help is great thanks.
    0

    proportion

    Observer
    Reputation: 0
    Posts: 6
    Joined: Tue Sep 18, 2012 9:03 pm
    Top
    Re: RPC Null reference
    by 2Kin » Wed Sep 26, 2012 7:06 am

    You have to instantiate your object over the network with PhotonNetwork.Instantiate, or use PhotonNetwork.AllocateViewID() and set it to your photonView.viewID.
    If you don't, your PhotonView won't be known by the server.

    i dont understand how to use allocateviewid, so i used PhotonNetwork.instantiate to create menus for each person, and all my rpc's work as they should. how do u call an RPC on a local thing?
  • 2Kin
    Options
    I only answered to one of your problem :
    proportion wrote:
    Illegal view ID:0 method: AddChat GO:EnterButton, and
    Received RPC "AddChat" for viewID 0 but this PhotonView does not exist!

    Just take a look at one of the Photon's example if you have problems designing your game.
  • sorted, did the local thing.