Garry's Mod Wiki

Garry's Mod Wiki

  Entity:DropToFloor( number mask = MASK_SOLID, Entity ignoreEnt = nil, number maxDist = 256 )

Description

Move an entity down until it collides with something.

Arguments

1 number mask = MASK_SOLID
Trace mask.
2 Entity ignoreEnt = nil
Trace ignore entity.
3 number maxDist = 256
Max trace dist.

Example

Move all props on the server down until they collide with something.

for _, ent in ipairs( ents.FindByClass( "prop_physics" ) ) do ent:DropToFloor() end

Example

Drops players to the ground when they spawn.

hook.Add( "PlayerSpawn", "DropGround", function( ply ) ply:DropToFloor() end )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...