• Entity frozen on spawn
    4 replies, posted
I'm spawning some custom entities on a timer with ent.Create, and even with all of the physics set properly, they are spawning frozen when I need them to fall. Any help is appreciated :)
Show your code?
[CODE]local function SpawnBuks() local x = math.random(-13000, 13000) local y = math.random(-13000, 13000) local ent = ents.Create( "bluebuk" ) if ( !IsValid( ent ) ) then return end // Check whether we successfully made an entity, if not - bail ent:SetPos( Vector( x, y, 513 ) ) ent:Spawn() ent:Activate() end local function SpawnTimer() timer.Create( "Sanic Spawn Timer", .5, 75, function() SpawnSanic() end) //Irrelevant timer.Create( "Buk Spawn Timer", 1, 5, function() SpawnBuks() end) end hook.Add( "Initialize", "Sanic Spawn Timer", SpawnTimer )[/CODE]
[code] local phys = ent:GetPhysicsObject() if ( IsValid( phys ) ) then phys:EnableMotion(true) phys:Wake() end [/code]
Thanks! Solved it :what:
Sorry, you need to Log In to post a reply to this thread.