Nonslipgritpool
Based on game build 714014 | Last updated: 2026-03-03
Overview
NonSlipGritPool is a component that enables an entity to act as a source of non-slip grit, typically used in icy or slippery environments to allow entities to walk without sliding. It is attached to entities (such as specific terrain features or placed objects) and provides a function to query whether a given world position is covered in grit. The component registers the nonslipgritpool tag on the owning entity and supports both custom grit-detection logic and a fallback radius-based check.
Usage example
local inst = CreateEntity()
inst:AddComponent("nonslipgritpool")
-- Set a custom grit detection function (e.g., based on placement mesh)
inst.components.nonslipgritpool:SetIsGritAtPosition(function(entity, x, y, z)
-- Custom logic here
return false
end)
-- Or rely on default radius check if Physics component is present
Dependencies & tags
Components used: None identified
Tags: Adds nonslipgritpool; removed on entity removal.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
isgritatfn | function or nil | nil | Optional callback used to determine if a point is grit-covered. Signature: fn(entity, x, y, z) → boolean. |
Main functions
SetIsGritAtPoint(fn)
- Description: Sets a custom function to determine whether a point (
x,y,z) is covered in non-slip grit. This overrides the default radius-based logic. - Parameters:
fn(function ornil) – a function that takesentity,x,y, andzand returnstrueif grit is present at that point, ornilto disable custom logic. - Returns: Nothing.
IsGritAtPosition(x, y, z)
- Description: Checks whether the point (
x,y,z) is covered in grit. Uses either the customisgritatfn(if set) or a distance check against the entity’s physics radius. - Parameters:
x(number) – X coordinate of the point to check.
y(number) – Y coordinate of the point to check.
z(number) – Z coordinate of the point to check. - Returns:
boolean–trueif the point is covered in grit,falseotherwise. - Error states: Returns
falseif no custom function is defined and the owning entity lacks aPhysicscomponent.
Events & listeners
None identified