Hey guys, i'm making a entity, but it wont spawn correctly ingame, when I spawn, the ragdoll is stiff, you cant pick it up.. Is there any possible way to make the entity recognise its a ragdoll, and spawn correctly? Heres my init.lua file
[lua]AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( 'shared.lua' )
function ENT:SpawnFunction( ply, tr )
local SpawnPos = tr.HitPos + tr.HitNormal * 16
local ent = ents.Create( "sent_kitty" )
ent:SetPos( SpawnPos )
ent:Spawn()
ent:Activate()
end
function ENT:Initialize()
self.Entity:SetModel( "models/feline.mdl" )
local phys = self.Entity:GetPhysicsObject()
if (phys:IsValid()) then
phys:Sleep()
end
end
Delay = 0
function ENT:Touch( ply )
if (CurTime() >= Delay) then
ent:EmitSound("Gravity Cat.mp3", 500, 200)
Delay = CurTime() + 24
end
end[/lua]
SEnts can't be ragdolls, you can try and link your SEnt to a prop_ragdoll.
How would you do that?
Basically, you spawn a regular ragdoll, and then make an invisible entity which controls it. Depends on what you want your ragdoll to do.
I want it to hover above my head.
Can you use [b][url=http://wiki.garrysmod.com/?title=Constraint.Weld]Constraint.Weld [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] on individual ragdoll bones? If so couldn't you just create a ragdoll with a bone or multiple bones welded to the entity?
You could if you wanted it to turn out badly.
I'd do it by finding the bones and applying force/setting position to player/parenting some of them, depending on what I want. Too bad that I don't know how to find ragdoll bones.
Sorry, you need to Log In to post a reply to this thread.