Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Sending commands that aren't from the local player object

Discussion in 'Multiplayer' started by SeriousBusinessFace, Jun 11, 2015.

  1. SeriousBusinessFace

    SeriousBusinessFace

    Joined:
    May 10, 2014
    Posts:
    127
    This currently seems unsupported. Is this an intentional feature, or is it something that's intended to be fixed?
     
  2. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    This is deliberately not allowed for security reasons. Only the owner of a player object can send commands.
     
  3. RalfZimmer

    RalfZimmer

    Joined:
    Jul 24, 2013
    Posts:
    8
    how can I create more player objects? My Game need control more than one player object.
    When I Spawn a new on a server I have no control on the client side
     
  4. Indiefreaks

    Indiefreaks

    Joined:
    Nov 12, 2012
    Posts:
    89
    Why would you need to create more than one player object?

    You may be a little confused with this "Player Object" concept.
    A Player Object in UNET is simply a GameObject which is created with all its components in every client and server for your game.
    Depending on the game you make, you may have to choose to make this player object an object that is actually visible on the scene or some kind of "control" object for your player.

    For instance, if you make a space shooter game where your player controls only one spaceship at any given time, your "Player Object" could be the prefab of the spaceship with all its properties and behaviours attached to it.
    Now, if you were making a Real Time Strategy game, since your player would probably control multiple units and buidings, you'd use this "Player Object" as a prefab containing all the necessary properties and methods to create those units and buildings on the server.

    Hope it gives you some clues to move on. ;)