Shape | CraytaKit
Skip to main 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.

Functions

Function NameReturn TypeDescriptionTags
AddImpulse(Vector impulse)NoneAdd impulse. An integral of force over a time interval. Newton SecondsNone
AddAngularImpulse(Rotation rotation)NoneAdd Angular Impulse. An integral of torque over a time interval. Newton seconds.None

Properties

Property NameReturn TypeDescriptionTags
shapeShapeAsset shapeGet/set the shape asset used by this entityRead-Write
colorColor colorGet/Set the color tint of the shapeRead-Write
shapeScaleVector scaleGet or change the scaleRead-Write
collisionEnabledbooleanTurn on or off collision (ie calling entry point OnCollision).Read-Write
onCollisionEvent eventCalled 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.Read
physicsEnabledbooleanTurn on or off physics.Read-Write
gravityEnabledbooleanTurn on or off gravity.Read-Write
© 2024 CraytaKit