local ghost = Part()
ghost.CanCollide = false
ghost.Transparency = 0.5
ghost.Parent = world
PhysicsInstance
Inherits: DynamicInstance
PhysicsBody is a dynamic instance that can be moved and interacted with in the game world.
Properties
Indicates whether the PhysicsBody is anchored in place.
The angular velocity of the PhysicsBody.
Indicates whether the PhysicsBody can collide with other objects.
The linear velocity of the PhysicsBody.
local ball = Part()
ball.Shape = PartShape.Ball
ball.Parent = world
ball.LinearVelocity = Vector3(0, 50, 0)
The client ID that has local physics authority over this body. 0 means the server simulates it.
Functions
Returns an array of all PhysicsInstances currently touching this PhysicsInstance.
local sensor = world.FindFirstChild("Sensor")
if sensor:
for hit in sensor.GetTouching():
if hit.IsA("Part"):
hit.Color = Color3(1, 0, 0)
local bodyA = world.FindFirstChild("BodyA")
local bodyB = world.FindFirstChild("BodyB")
if bodyA and bodyB:
local weld = bodyA.MakeJoint(bodyB)
Removes any welds between this PhysicsBody and the other PhysicsBody.
Grants physics authority over this body (nil releases it to the server).
Signals
Properties
The coordinate matrix (CMatrix) representing the DynamicInstance's position and rotation transform in the world, in local space.
The position of the DynamicInstance. This is a shortcut for setting CMatrix.Position.
The rotation of the DynamicInstance as a quaternion. This is a shortcut for setting Types.CMatrix.Quaternion.
The rotation of the DynamicInstance in Euler angles (degrees). This is a shortcut for setting Quaternion using Euler angles.
Functions
Creates a child speech bubble attached to this DynamicInstance with the given text.
Properties
The transparency of the VisualInstance.
Whether the VisualInstance is visible in the game world.
Properties
Whether this Instance or any of its descendants should be included when saving or copying via Clone()
The unique identifier for this Instance.
If true, this instance and all of its descendants cannot be selected in the editor.
The name of this Instance.
The parent of this Instance in the hierarchy.
The sort index of this Instance among its siblings. If this Instance has no parent, this value is ignored.
Functions
Attaches a script to this instance by its file path. The path should be relative to the root assets directory, e.g. "Scripts/MyScript".
Creates a deep clone of this Instance and all its descendants.
Removes this Instance, and all its descendants, from the DataModel, and locks its parent property.
Schedules this Instance to be destroyed after the specified delay in seconds. This function will error if called multiple times.
Removes a script from this instance by its file path. The path should be relative to the root assets directory, e.g. "Scripts/MyScript".
Returns an array of the children of this Instance.
Gets the global bounding box that encapsulates all DynamicInstance children of this Instance.
Returns the path of the script component at , or an empty string if the script file no longer exists.
Determines if this Instance is a descendant of the specified ancestor Instance.