PhysicsGetChildShapes

From Multi Theft Auto: Wiki
Revision as of 15:04, 12 February 2020 by CrosRoad95 (talk | contribs) (Created page with "__NOTOC__ {{Client function}} Returns all child shape of compound shape. ==Syntax== <syntaxhighlight lang="lua"> table physicsGetChildShapes(physics-shape compoundShape) </...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Returns all child shape of compound shape.

Syntax

table physicsGetChildShapes(physics-shape compoundShape)

Required Arguments

  • compoundShape: Must be compound shape

Returns

Returns table of all shapes. {shape, shape, shape, ...}. False otherwise

Example

Creates something that reminds chain

local compound = physicsCreateShape(physics, "compound")
local capsule = physicsCreateShape(physics, "capsule", 1, 1)
physicsAddChildShape(compound, capsule)
physicsAddChildShape(compound, capsule)
physicsAddChildShape(compound, capsule)
local childShapes = physicsGetChildShapes(compound);
outputChatBox("Your compound shape is made of ".. #childShapes .. " capsules")

See Also