Search Unity

Third Party How to update ragdol in Photon Unity Networking

Discussion in 'Multiplayer' started by tafeczek, Dec 7, 2018.

  1. tafeczek

    tafeczek

    Joined:
    Sep 23, 2017
    Posts:
    7
    Hello, everyone i have problem with sync character


    Code (CSharp):
    1.         foreach(Rigidbody element in rigiBodyArray)
    2.         {
    3.             element.isKinematic = false;
    4.         }
    5.  
    6.         myPlayer.GetComponent<CharacterController>().enabled = false;
    7.         myPlayer.GetComponent<FPSInputController>().enabled = false;
    8.         myPlayer.GetComponent<MouseLook>().enabled = false;
    9.         myPlayer.GetComponent<Character3rd>().enabled = false;
    10.         myPlayer.GetComponent<CameraMenuMove>().enabled = false;
    11.         myPlayer.GetComponent<CharacterMotor>().enabled = false;
    12.         myPlayer.GetComponent<Animator>().enabled = false;
    How can i update player information and send to other player i don't idea to create RPC

    Thank you for answer
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    A quick note/sanity check (not solution) As ragdolls typically do not affect gameplay I suggest not synching them at all and just keeping each ragdoll a locally simulated body.

    This is the general case for all non-gameplay impacting features across the network in most games, example would be particle systems (they're spawned across the network but only exist on the client with no further synching).
     
    tobiass likes this.
  3. tafeczek

    tafeczek

    Joined:
    Sep 23, 2017
    Posts:
    7
    if I do not sync do it, the player will be standing all the time
     
  4. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    You need to disable the code, that reads the incoming updates for a networked object, when you want the ragdoll system to take over. It should be similar to how you do it in singleplayer: Once a character is animated as ragdoll, you'd turn off the controller, right?