Quantcast
Channel: Questions in topic: "ragdoll"
Viewing all articles
Browse latest Browse all 565

Ragdoll Death Script

$
0
0
can any1 plz tell me how to make a ragdoll death script ie If a player dies then i want the player to be destroyed and ragdoll to come, taking the position of the player......right now the instantiated ragdoll is taking the position and rotation of the player but not the positions and rotation of the bones.. this is my script for bones positioning which is not working.... public class Ragdoll : MonoBehaviour { private List poseBones = new List(); private List ragdollBones = new List(); public void CopyPose(Transform pose) { AddChildren(pose, poseBones); AddChildren(transform, ragdollBones); foreach (Transform b in poseBones) { foreach (Transform r in ragdollBones) { if (r.name == b.name) { r.eulerAngles = b.eulerAngles; break; } } } } public void AddChildren(Transform parent, List list) { list.Add(parent); foreach (Transform t in parent) { AddChildren(t, list); } } }

Viewing all articles
Browse latest Browse all 565

Trending Articles