Description
The GameObjectFlags.Absolute
field is a member of the GameObjectFlags
enumeration in the Sandbox API. This flag is used to specify that a game object should ignore its parent transform, effectively making its position absolute in the scene. This is similar to the concept of position: absolute
in CSS, where the element is positioned relative to its closest positioned ancestor or the initial containing block if no such ancestor exists.
Usage
Use the GameObjectFlags.Absolute
flag when you want a game object to maintain its position independently of its parent. This can be useful in scenarios where the game object needs to be positioned at a specific location in the world space, regardless of any transformations applied to its parent.
Example
// Example of using GameObjectFlags.Absolute
GameObject myObject = new GameObject();
myObject.Flags |= GameObjectFlags.Absolute;
// This will ensure that myObject's position is not affected by its parent's transform.