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.

Unity Multiplayer [SOLVED-ish]How do i get the callback that triggers MsgType.Owner?

Discussion in 'Multiplayer' started by rob_vld, Jun 24, 2015.

  1. rob_vld

    rob_vld

    Joined:
    Jul 9, 2013
    Posts:
    184
    HLAPI, C#

    Following the guide on http://docs.unity3d.com/Manual/UNetSpawning.html

    I have reached "A network message of type MsgType.Owner is sent to the client that added the player (only that client!) "

    Not sure if this is required or what this message actually contains, but how do i capture this network message?

    thanks.
     
  2. rob_vld

    rob_vld

    Joined:
    Jul 9, 2013
    Posts:
    184
    I just found out it should be triggered by OnOwnerMessage( ) according to the dev-logs MsgType.Owner is 4

    as of yet it is not triggering though...
     
  3. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    use OnStartLocalPlayer.
     
  4. rob_vld

    rob_vld

    Joined:
    Jul 9, 2013
    Posts:
    184
    @seanr I was about to edit my message...

    OnStartLocalPlayer doesnt trigger in my main script or playerscript
     
  5. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    you cant trap the owner message, it is an internal system message. Anyway, it causes OnStartLocalPlayer to be called.

    What are you actually trying to do?
     
  6. rob_vld

    rob_vld

    Joined:
    Jul 9, 2013
    Posts:
    184
    Learning all about this wonderfull HLAPI UNET ofcourse! :p

    I am trying to figure out what is possible and how to approach it codewise...
    i have managed to setup a standalone server and client, with player spawn.

    My next goal is having the client move about; hoping the server is authoritative and the NetworkTransform of the player movement is synced (Interpolation/Extrapolation) ?

    In any case OnStartLocalPlayer is not triggering on the player script, however, isLocalPlayer is set to true, so i am assuming it works...
     
    Last edited: Jun 24, 2015