Skip to main content

Transform.SetParent(Transform parent, boolean worldPositionStays)

Set the parent of the transform.

Parameters:

NameTypeDescription
parentTransformThe parent Transform to use.
worldPositionStaysbooleanIf true, the parent-relative position, scale and rotation are modified such that the object keeps the same world space position, rotation and scale as before.

Usage

---@type Transform
local transform;

---@type Transform
local parent;

---@type boolean
local worldPositionStays;


transform.SetParent(parent, worldPositionStays)