D
Type
Initialised Value
Description
-- entity.lua
local function init(self)
self.Physics = true
local box_shape = api.physics.NewBoxShape(1, 1, 3.4)
local box = api.physics.NewBody(box_shape, 1)
self.Body = box
end
local function update(self, dt)
local shape = self.Body.Shape
if shape.D < 50 then
shape.D = shape.D + 0.001
end
self.Data.measurements= {
x = shape.W,
y = shape.L,
z = shape.D
}
print("Storing shape dimensions, to be accessible to all client connections.")
end
-- Create a box shape and a body. Assign it to the entity.
-- Gradually increase the depth of the entity body to a maximum of 50.
-- Record the changes in the entity's Data table.
-- On the clientside, handle the data from the automatic entity update.
-- Prints:
-- Storing shape dimensions, to be accessible to all client connections.Last updated