Search Unity

UNET No Authority while it should.

Discussion in 'Scripting' started by timoshaddix, Sep 28, 2016.

  1. timoshaddix

    timoshaddix

    Joined:
    Jan 7, 2014
    Posts:
    64
    I'm getting the error: "Trying to send command for object without authority"
    I managed to get it working on another game object,
    But on this game object i'm getting this error.
    This only happens on Client side, host side is working perfectly.
    My GameObject is not a local player, but it does have a network identity with local player authority.
    Does anyone have a clue why it has no authority?
     
    Last edited: Sep 28, 2016
  2. Benj4_

    Benj4_

    Joined:
    Nov 12, 2015
    Posts:
    38
    I'll Don't Really Recommend UNet, Get Photon Or Make Your Own Multiplayer API

    I Have REALLY Bad Trouble With UNet
     
  3. timoshaddix

    timoshaddix

    Joined:
    Jan 7, 2014
    Posts:
    64
    I know photon is a good choice too, but i really want to stick to UNET.
    On the other hand, i enabled auto create player on my network manager and it worked,
    the problem now is, it creates an object for the host and for the client, while only the host needs an online object to be spawned, is there a way to spawn the object like it would be spawned with "Auto create player" but not automatic, it has be me manually.

    cheers
     
  4. Vedrit

    Vedrit

    Joined:
    Feb 8, 2013
    Posts:
    514
    I've noticed issues with setting the network ID to local player authority, namely that it doesn't work. At all. It's better, I think, to get the netID of a specific player you want to give authority to (You can't, it seem, make an object under authority of all players) and use SpawnWithLocalAuthority
     
  5. timoshaddix

    timoshaddix

    Joined:
    Jan 7, 2014
    Posts:
    64
    How exactly would i do that? i'm quite new to networking, so i have no clue yet. :)