Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Unity Multiplayer How to update ragdol in Photon Unity Networking

Discussion in 'Connected Games' 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 Moderator

    Joined:
    Apr 11, 2010
    Posts:
    24,481
    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:
    2,102
    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?