util.IsInWorld

From Garry's Mod
Jump to: navigation, search
 util.IsInWorld( )

Contents

Description

Checks if a certain position in within the world bounds.

Arguments

Vector position

Position to check.

Returns

boolean

Whether the vector is in world.

Examples

Example

Here's a trick you can do to achieve the behavior of this function on the client.

(This may be less efficient than the serverside function itself)

local tr = { collisiongroup = COLLISION_GROUP_WORLD }
function util.IsInWorld( pos )
	tr.start = pos
	tr.endpos = pos
	return util.TraceLine( tr ).HitWorld
end


Personal tools
Navigation