Skip to content

Shape

An Entity can have a single physical representation. Shape derives from Entity so if you have a Shape you can do any of these functions as well as the functions in Entity. You can do entity:IsA(Shape) to see if a particular entity variable is a Shape type entity.

Parent: Entity

Functions

Function Name Usage Description Notes
AddImpulse shape:AddImpulse(Vector impulse) Add Impulse. An integral of force over a time interval. Newton seconds.
AddAngularImpulse shape:AddAngularImpulse(Rotation angularImpulse) Add Angular Impulse. An integral of torque over a time interval. Newton seconds.

Parameters

Parameter Name Usage Description Notes
shape ShapeAsset shape Get/set the shape asset used by this entity
color Color color Get/Set the color tint of the shape
shapeScale vector shapeScale Get or change the scale
collisionEnabled bool collisionEnabled Turn on or off collision (ie calling entry point OnCollision).
onCollision Event onCollision Called when this entity is collided with by a player Character with the Character passed as an argument, as well as the mesh Entity from which the onCollision event was triggered. An alternative to listening for OnCollision in a script on the entity.
physicsEnabled bool physicsEnabled Turn on or off physics.
gravityEnabled bool gravityEnabled Turn on or off physics.

Overrides

Override Name Usage Description Notes
new_index shape.var = object value