SetPropCollision
Whether players walk into a prop or through it.
A static prop is solid unless you say otherwise: players, horses and arrows stop at it. false lets everyone walk through
it - a decoration in a doorway, a sign over a path; true makes it solid again, at once on every screen. Meshes the game
makes no collision for on their own (one built of several collision pieces, such as a crate or a shrine) get one made for them
while they are solid. A rigid prop (CreateProp with rigid) is a physics body and always solid.
Syntax
Section titled “Syntax”SetPropCollision(id [, solid])| Parameter | Type | |
|---|---|---|
id |
number | the prop |
solid |
boolean | true (the default) solid, false walked through (optional) |
Returns
Section titled “Returns”boolean - false for anything that is not a static prop
Example
Section titled “Example”local barrel = CreateProp("barrel_a", x, y, z, yaw)SetPropCollision(barrel, false) -- a ghost barrel: the players walk through itSee also
Section titled “See also”IsPropSolid · CreateProp · SetEntityPrompt · the Props group of the index
