VoxelMesh | CraytaKit
Skip to main content

VoxelMesh

Functions

Function NameReturn TypeDescriptionTags
SetVoxel(Vector pos, VoxelAsset voxel)NoneChange a single voxel in world spaceServer Only
SetVoxelBox(Vector pos, Vector dimensions, VoxelAsset voxel)NoneChange a cuboid of voxels with given dimensions in world units (centimeters). 1 voxel = 25cmServer Only
SetVoxelBox(Vector pos, number halfSize, VoxelAsset voxel)NoneChange a cube of voxels with a given half-size in world units (centimeters) for each axis. 1 voxel = 25cmServer Only
SetVoxelSphere(Vector pos, Vector dimensions, VoxelAsset voxel)NoneChange an elipsoid of voxels with given dimensions in world units (centimeters). 1 voxel = 25cmServer Only
SetVoxelSphere(Vector pos, number radius, VoxelAsset voxel)NoneChange a sphere of voxels with a given radius in world units (centimeters). 1 voxel = 25cmServer
ResetVoxels()NoneReset any SetVoxel...() calls that have been done during play, returning the voxel prop to its starting state (ie as it was in the editor)Server Only
CreateThruster()ThrusterAdd a thruster to a voxel meshNone
CreateRelativeThruster()ThrusterAdd a thruster to a voxel meshNone
DestroyThruster(Thruster handle)NoneDestroy a thrusterNone
AddImpulse(Vector impulse)NoneAdd Impulse. An integral of force over a time interval. Newton secondsNone
AddAngularImpulse(Rotation rotation)NoneAdd an angular impulse. An integral of torque over a time interval. Newton secondsNone

Properties

Property NameReturn TypeDescriptionTags
meshMeshAssetSet or get the mesh assetRead-Write
collisionEnabledbooleanTurn on or off collision (ie calling entry point OnCollision)Read-Write
damageEnabledbooleanTurn on or off damage (ie calling of entry point OnDamaged)Read-Write
physicsEnabledbooleanTurn on or off physicsRead-Write
gravityEnabledbooleanTurn on or off gravityRead-Write
onCollisionEventCalled when this entity is collided with by a player Character with the Character passed as an argument, as well as the voxel mesh Entity from which the onCollision event was sent. An alternative to listening for OnCollision in a script on the entityRead
onDamageEventCalled when this entity is damaged with the amount of damage, the entity causing the damage and a HitResult structure, as well as the voxel mesh Entity from which the onDamage event was sent. An alternative to listening for OnDamage in a script on the entityRead

Examples

© 2024 CraytaKit