Garry's Mod Wiki

Entity:Activate

Entity:Activate()

Description

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

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
Calling this method after Entity:SetModelScale will recreate a new scaled SOLID_VPHYSICS PhysObj on scripted entities. This can be a problem if you made a properly scaled PhysObj of another kind (using Entity:PhysicsInitSphere for instance) or if you edited the PhysObj's properties. This is especially the behavior of the Sandbox spawn menu.
This crashes the game with scaled vehicles.

Issue Tracker: 3372

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

Page Links


Special Pages


Wikis

?

Render Time: 56ms

DB GetPage 23
Generate Html 8
SaveChanges (1) 10
Render Body 0
Render Sidebar 12