How do I spawn a ragdoll with its bones already set to a certain position? I tried using SetSequence and SetCycle before [I]and[/I] after spawning it, but nothing happened. I also tried setting the [URL="https://developer.valvesoftware.com/wiki/Prop_ragdoll"]"sequence" key value for ragdolls[/URL], but nothing happened. Any ideas??
Spawn the ragdoll then do a for loop through it's bones and set each one to your desired position.
[QUOTE=Ice Tea;41701313]Spawn the ragdoll then do a for loop through it's bones and set each one to your desired position.[/QUOTE]
Lets say I want to create a ragdoll of an entity, being an NPC, Player, bot, or anything else with a model that util.IsValidRagdoll() works on. To know where to set the position of a ragdoll's bone to, I would have to know the position of the entity's corresponding [I]bone[/I] bone, which I could obtain using either GetBonePosition() or GetBoneMatrix(). This is where problems start.
The positions of the entity's [U]bones[/U], found using GetBoneMatrix() or GetBonePosition(), don't perfectly match the [I]correct[/I] positions of the ragdoll's [U]physics bones[/U]. And since ragdoll physics bones [I]strictly[/I] follow sets of built-in constraint rules, if you try to set its position or angles outside of it's allowed position or angles, it (and the rest of the ragdoll) will immediately try to compensate by snapping to the nearest allowed position. What i'm actually trying to do here is create a frozen copy of the original entity by "statuing" the ragdoll I create; and if you statue a ragdoll while it's physics bones are set to positions outside of their allowed positions, the entire frozen ragdoll will [B]SPAZZ[/B] all over the map.
Also, this method only applies to physics bones, and not the ragdoll's other bones.
Then look at the statue tool code in sandbox.
[QUOTE=Ice Tea;41703100]Then look at the statue tool code in sandbox.[/QUOTE]
The statue tool has nothing to do with this... It just connects every physbone to the base physbone using a phys_constraint... I'm not even using the actual SandBox tool, i'm just replicating what it does in my code...
The problem is i'm trying to position a ragdoll's bones and physbones correctly so that [I]it can be[/I] "statued" by any means without it spazzing out.
Sorry, you need to Log In to post a reply to this thread.