PVInstance
Inherits Instance
PVInstance introduces 3D transform properties (Position, Rotation, Scale) to any Instance, without adding physics or collision logic.
Properties
Methods
GetWorldPosition()
Vector3Computes the world position based on parent hierarchy
GetWorldRotation()
Vector3Computes the world rotation based on parent hierarchy
Checks if this instance has a specific tag
Parameters:
tagstring
Removes a tag from this instance
Parameters:
tagstring
Gets the value of an attribute
Parameters:
attributestring
Returns a table of all attributes
Sets the value of an attribute
Parameters:
attributestringvalueAttribute
part:SetAttribute("Health", 100)
local health = part:GetAttribute("Health")
Finds the first ancestor with the specified name
Parameters:
namestring
Finds the first ancestor of the specified class
Parameters:
classNamestring
Finds the first ancestor that is an instance of the class
Parameters:
classNamestring
Finds the first direct child with the specified name
Parameters:
namestring
Finds the first direct child of the specified class
Parameters:
namestring
Finds the first child that is an instance of the class
Parameters:
namestring
Finds the first descendant with the specified name
Parameters:
namestring
Returns an array of all direct children
for _, child in ipairs(workspace:GetChildren()) do
print(child.Name)
end
Returns an array of all descendants
Checks if this instance is an ancestor of the target
Parameters:
descendantInstance
Checks if this instance is a descendant of the target
Parameters:
ancestorInstance
Removes and destroys all children
Permanently destroys this instance and all descendants
Sets the parent of this instance
Parameters:
newParentInstance - | nil
Adds a child to this instance
Parameters:
childInstance
Removes a child from this instance
Parameters:
childInstance
Checks if this object is an instance of the specified class
Parameters:
classNamestring
Triggers the Changed event for a specific property
Parameters:
propertyNamestring
Events
Fires when the instance's ancestry changes
Fires when an attribute is changed
Fires when a child is added to this instance
Fires when a child is removed from this instance
Fires when a descendant is added anywhere in the tree
Fires when a descendant is about to be removed
Fires when this instance is being destroyed
Fires when a property of this object changes
part.Changed:Connect(function(property)
print("Property changed:", property)
end)