Skip to content
Matías Hermosilla edited this page Mar 11, 2018 · 8 revisions

The 'Body' Object

Importing

local Body = require("shadows.Body")

Functions

Body Body = Body:new(World World)
Description: Creates a body.

local World = World:new()		-- Create a new world
local newBody = Body:new(World)		-- Add a body to this world

Methods

Body:TrackPhysics(Body Body)
Description: Associates a body with a physics body.

Body Body = Body:GetTrackedPhysics()
Description Returns the physics body associated with the body.

Body:SetAngle(number Angle)
Description: Changes the angle of the body.

number Angle = Body:GetAngle()
Description: Gets the angles of the body.

Body:SetPosition(number x, number y, number z)
Description: Sets the position of the body.

number x, number y, number z = Body:GetPosition()
Description: Gets the position of the body.

Body:Remove()
Description: Removes a body.

Transform transform = Body:GetTransform()
Description: Gets the transform associated with the body.

Clone this wiki locally