• How to make ents frozen on spawn?
    3 replies, posted
So i am making a tree entity that once damaged with the right weapon will produce wood, however, i am making that it will spawn on certain cords. The problem is that once spawned, it will spawn, ermmm, not frozen. Once spawned, the tree falls over, or goes straight into the map, and bugs out with the collision. Is there a way to freeze entities when they are spawned in by the player or a script?
I'd suggest not using physics entities for this and instead use prop_dynamic ( or its SENT alternative, MOVETYPE_NONE )
[QUOTE=Robotboy655;50477378]I'd suggest not using physics entities for this and instead use prop_dynamic ( or its SENT alternative, MOVETYPE_NONE )[/QUOTE] Ah, thanks :D
make it to take no damage first if you want [CODE]/*--------------------------------------------------------- Name: OnTakeDamage ---------------------------------------------------------*/ function ENT:OnTakeDamage(dmginfo) end [/CODE] and heres a normal setup for custom entities [CODE]/*--------------------------------------------------------- Name: Initialize ---------------------------------------------------------*/ function ENT:Initialize() local model = ("models/Items/item_item_crate.mdl") self.Entity:SetModel(model) self.Entity:PhysicsInit(SOLID_VPHYSICS) -- THATS WHAT YOU NEED TO MAKE IT FROZEN self.Entity:SetMoveType(MOVETYPE_VPHYSICS) -- THATS WHAT YOU NEED TO MAKE IT FROZEN self.Entity:SetSolid(SOLID_VPHYSICS) -- THATS WHAT YOU NEED TO MAKE IT FROZEN self.Entity:DrawShadow(false) self.Entity:SetCollisionGroup(20) local phys = self.Entity:GetPhysicsObject() if (phys:IsValid()) then phys:Wake() phys:SetMass(40) -SET MASS ON IT(you dont have to) end self.Entity:SetUseType(SIMPLE_USE) end[/CODE]
Sorry, you need to Log In to post a reply to this thread.