Garry's Mod Wiki

Entity:Dissolve

  Entity:Dissolve( number type = 0, number magnitude = 0, Vector origin = nil, number delay = 0 )

Description

Dissolves the entity.

This function creates an env_entity_dissolver entity internally, which is parented to the target entity and remains until the entity is fully dissolved. Calling this function on an entity that is already dissolving will not create another env_entity_dissolver entity.

Arguments

1 number type = 0
Dissolve type. Should be one of the following values:

ID Description
0 ENTITY_DISSOLVE_NORMAL
1 ELECTRICAL
2 ELECTRICAL_LIGHT
3 ENTITY_DISSOLVE_CORE
2 number magnitude = 0
Magnitude of the dissolve effect, its effect depends on the dissolve type.
3 Vector origin = nil
The origin for the dissolve effect, its effect depends on the dissolve type. Defaults to entity's origin.
4 number delay = 0
Delay until starting the dissolve, in seconds. There will be some particles produced during this time.

This was recently added in version (2026.05.19). It might only be available on the Dev Branch right now.

Example

A console command that will dissolve whatever the played is looking at, with a 3 second delay.

if ( SERVER ) then concommand.Add( "dissolve", function( ply ) local plyTr = ply:GetEyeTrace() if ( IsValid( plyTr.Entity ) ) then plyTr.Entity:Dissolve( 0, 0, nil, 3 ) end end ) end