• How to give an entity ragdoll-like physics
    5 replies, posted
[code] function ENT:Initialize() if SERVER then self:SetModel( "models/Humans/Group01/male_09.mdl" ) self:PhysicsInit( SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_FLYGRAVITY ) self:SetSolid( SOLID_VPHYSICS ) self:SetUseType( SIMPLE_USE ) local phys = self:GetPhysicsObject() if (IsValid(phys)) then phys:EnableMotion( true ) end end end [/code] I'm confused as to how I could edit this to make my entity have ragdoll-like physics(the model I'm using is a ragdoll)
You cannot.
[QUOTE=Robotboy655;47895593]You cannot.[/QUOTE] I heard that in an ENT code if you use ENT = game.GetEntities( )[ 'prop_ragdoll' ] then that will work. But, GetEntities is deprecated, so what is the new function similar to it?
[QUOTE=A Fghtr Pilot;47895597]I heard that in an ENT code if you use ENT = game.GetEntities( )[ 'prop_ragdoll' ] then that will work. But, GetEntities is deprecated, so what is the new function similar to it?[/QUOTE] game.getentities is a table of all the entities (Or It looks like it any ways, from the name), If you want to use it then remake the table. Or use ents.getall
[QUOTE=A Fghtr Pilot;47895597]I heard that in an ENT code if you use ENT = game.GetEntities( )[ 'prop_ragdoll' ] then that will work. But, GetEntities is deprecated, so what is the new function similar to it?[/QUOTE] In case you haven't heard the first time, you cannot. There's no such function. I doubt there ever was such a function.
Yeah, you cannot turn an entity into a ragdoll just like that. The alternative is to create a new ragdoll, place it in the place of the entity (making the entity not solid and positioning every ragdoll bone with the entity bone), and then destroy (or hide) the original entity and let the ragdoll collapse in its stead.
Sorry, you need to Log In to post a reply to this thread.