The Transform
property of a GameObject
provides the position, rotation, and scale of the object relative to its parent. If the GameObject
does not have a parent, the transform is relative to the scene.
The Transform
property of a GameObject
provides the position, rotation, and scale of the object relative to its parent. If the GameObject
does not have a parent, the transform is relative to the scene.
Use the Transform
property to access or modify the local transformation of a GameObject
. This includes its position, rotation, and scale in relation to its parent object or the scene if it has no parent.
// Example of accessing the Transform property GameObject myObject = new GameObject(); GameTransform transform = myObject.Transform; // Modify the position of the GameObject transform.Position = new Vector3(10, 0, 5); // Rotate the GameObject transform.Rotation = Rotation.FromAxis(Vector3.Up, 45); // Scale the GameObject transform.Scale = new Vector3(1.5f, 1.5f, 1.5f);