From Multi Theft Auto: Wiki
Revision as of 19:11, 19 February 2020 by CrosRoad95 (talk | contribs) (→‎Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Returns type of physics-element


string physicsGetElementType(physics-element thePhysicsElement)             

Required Arguments

  • thePhysicsElement: physics element: shape, constraint, rigid body, static collision


Name of physics element, "shape", "rigidbody", "staticcollision", "constraint"


local shape = physicsCreateShape(physics, "box", 1)
local rb = physicsCreateRigidBody(shape)
local col = physicsCreateStaticCollision(shape)
local const = physicsCreateConstraint("pointtopoint", rb, 0,0,0)
iprint("shape: ",physicsGetElementType(shape)) -- shape
iprint("rigidbody: ",physicsGetElementType(rb)) -- rigidbody
iprint("staticcollision: ",physicsGetElementType(col)) -- staticcollision
iprint("constraint: ",physicsGetElementType(const)) -- constraint
iprint("invalid: ",physicsGetElementType(physics)) -- false

See Also