Skip to content

Api > Transform > SetParent()


Transform.SetParent(Transform parent, boolean worldPositionStays)⚓︎

Set the parent of the transform.

Parameters:⚓︎

Name Type Description
parent Transform The parent Transform to use.
worldPositionStays boolean If 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)