- Add Component class documentation with lifecycle methods - Add GameObject class documentation with component system - Add TransformComponent documentation with transform methods - Add Scene class documentation with GameObject management - Add SceneManager singleton documentation with scene loading - Update components.md overview with all component classes - Update main.md navigation with Scene module
775 B
775 B
SetParent
Set the parent transform.
Syntax
void SetParent(TransformComponent* parent, bool worldPositionStays = true);
Parameters
parent- The new parent transform, ornullptrto detach from parent.worldPositionStays- Iftrue, the world position remains unchanged after reparenting.
Remarks
Sets the parent of this transform. When worldPositionStays is true, the world position is preserved, which may adjust the local position. When false, the local position is preserved, which may adjust the world position.
See Also
Examples
void Example(TransformComponent* child, TransformComponent* newParent) {
child->SetParent(newParent, true);
}