Mesh
An Entity can have a single physical representation. Mesh is for 3D objects that exist in the scene. They can be collided with and recieve damage when hit. Mesh derives from Entity so if you have a Mesh you can do any of these functions as well as the functions in Entity. You can do entity:IsA(Mesh) to see if a particular entity variable is a Mesh type entity.
Functions
Function Name |
Usage |
Description |
Notes |
PlayAnimation |
mesh:PlayAnimation(string animationName) |
Play a named animation on this mesh, once. |
|
PlayAnimation |
mesh:PlayAnimation(string animationName, bool looping) |
Play a named animation on this mesh, optionally looping. |
Unsupported |
PlayAnimationLooping |
mesh:PlayAnimationLooping(string animationName) |
Play a named animation on this mesh, repeatedly. |
|
PlayAnimationClient |
mesh:PlayAnimationClient(string animationName) |
Play a named animation on this mesh, once, for this client only |
|
PlayAnimationClient |
mesh:PlayAnimationClient(string animationName, bool looping) |
Play a named animation on this mesh, optionally looping, for this client only |
Unsupported |
PlayAnimationLoopingClient |
mesh:PlayAnimationLoopingClient(string animationName) |
Play a named animation on this mesh, repeatedly, for this client only |
|
GetAnimationNames |
table mesh:GetAnimationNames() |
Get a table of animation names that you can play on this mesh with PlayAnimation. |
|
CreateThruster |
Thruster mesh:CreateThruster() |
Add a thruster to an entity |
|
CreateRelativeThruster |
Thruster mesh:CreateRelativeThruster() |
|
|
DestroyThruster |
mesh:DestroyThruster(Thruster handle) |
Destroy a thruster |
|
AddImpulse |
mesh:AddImpulse(Vector impulse) |
Add Impulse. An integral of force over a time interval. Newton seconds. |
|
AddAngularImpulse |
mesh:AddAngularImpulse(Rotation angularImpulse) |
Add Angular Impulse. An integral of torque over a time interval. Newton seconds. |
|
Parameters
Parameter Name |
Usage |
Description |
Notes |
collisionEnabled |
bool collisionEnabled |
Turn on or off collision (ie calling entry point OnCollision). |
|
damageEnabled |
bool damageEnabled |
Turn on or off damage (ie calling of entry point OnDamaged). |
|
physicsEnabled |
bool physicsEnabled |
Turn on or off physics. |
|
gravityEnabled |
bool gravityEnabled |
Turn on or off physics. |
|
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. |
|
onDamage |
Event onDamage |
Called when this entity is damaged with the amount of damage, the entity causing the damage and a HitResult structure, as well as the mesh Entity from which the onDamage event was sent. An alternative to listening for OnDamage in a script on the entity. |
|
mesh |
mesh mesh |
Get or change the mesh |
|