Problems with ragdoll across a network - please help :)

Hey all.

I’m having some trouble with ragdolls in Unity and the community may be able to give some advice. Here’s the background:

I’m building a networked (online) 3rd person shooter. When a player kills another player a ragdoll instantiates and falls to the ground. The killing player can then shoot the ragdoll which physically reacts to the bullets, or he can pick up the ragdoll with telekenisis and throw it across the arena.

The questions and issues are:

  1. When the ragdoll instantiates there’s an obvious pause in the game of half a second as it loads the asset. The game then continues normally. This may be because it has a lot of bones (including fingers) in the ragdoll, and it may also be because I’ve added a network view component to each of the transforms in the ragdoll as this seems to make the ragdoll on both players computers appear in-sync - without it the two ragdolls were in different locations (not synced).

Is there anyway for me to just add a single network view on the ragdoll to have it in-sync across the network, or anyway to reduce to asset size so that frames don’t skip when it’s instantiated?

  1. After the ragdoll instantiates it sometimes disappears in the game view. The asset is still there in the scene but from certain angles it can’t be seen.

Has anyone come across this situation before? How can I handle this?

  1. When a player picks up a ragdoll body using telekenisis (mind power) I can do this by either using the ‘applyForce’ function which causes the ragdoll to move smoothly or the ‘movePosition’ function which causes the ragdoll to stretch and flicker like crazy. I would like to use the ‘apply force’ to pick up and walk the ragdoll around the scene smoothly but unfortunately the ragdoll will pingpong when dragged (move from left to right as the X and -X forces are applied). I’d like to have the ragdoll be dragged in the air smoothly, roughly 2 metres in front of the character so that the player can drag the ragdoll around the scene. It’s not a problem with a single physics object such as a cube but I don’t know how to do this with a ragdoll.

Can anyone advise on what code / functions to use for this mechanic?

  1. When the ragdoll is instantiated across the network it can then be dragged through the air. If I’m the player dragging the ragdoll it appears to move smoothly on my screen. However, if viewed on another players screen it apprears to flicker as it’s dragged across the screen.

Is this because I havn’t added any interpolation - extrapolation code to the network view components connected to the ragdoll? I’m worried about the asset getting too large if I add this script to each transform in the ragdoll as it already causes a slight pause when instantiated in the game. Does anyone know how to best handle this?

Thanks in advance for any answers guys, very much appreciated :slight_smile:

Best regards
-M

first make sure the ragdoll is in one prefab and has one network view not a lot. now what kind of build is this and what are the settings on the build? you might have to turn of the streamed option see if it helps.