Entity/Activate

From Garry's Mod
Jump to: navigation, search
 Entity:Activate( )

Description

Activates the entity. This needs to be used on some entities (like constraints) after being spawned.

NOTE

For some entity types when this function is used after Entity:SetModelScale, the physics object will be recreated with the new scale. Source-sdk-2013

BUG

This crashes the game with scaled vehicles.

Issue Tracker: #3372

Examples

Example

Spawns a 'sent_ball' on the player.

function ENT:SpawnMe(ply)
	local SpawningPos = ply:GetPos()
	local ent = ents.Create("sent_ball")
	ent:SetPos( SpawningPos ) 
	ent:Spawn()
	ent:Activate()
end


Personal tools
Navigation