public sealed struct Transform
A struct containing a position, rotation and scale. This is commonly used in engine to describe entity position, bone position and scene object position.
Related Guides
Broader workflow and conceptual references connected to this API.
If you want a specific file/asset type to have a custom Thumbnail/Inspector Preview, you can simply create an AssetPreview. An AssetPreview initializes a SceneWorld and SceneCamera, rendering the Camera to the Preview output, so all you need to do is populate it and/or position the Camera to your liking.
You can create your own editor tool to help you create your game. Your tool needs to be created in an editor project.
A GameObject represents an object in the scene world. It contains a few different elements.
GPU instancing is an optimization where multiple instances of the same model with the same material can be drawn in a single draw call. This is a big optimization when rendering things that appear many times in a scene such as foliage.
A Vector is just a set of numbers that describe a position or a direction in space.
Any game object can become a networked object by simply calling NetworkSpawn() on it. It will then be sent to all clients and can have Sync Properties and RPC Messages.
Constructors
Showing 4 constructors
No results match this filter.
Methods
Showing 21 methods
public Transform Add(Vector3 position, bool worldSpace)
Add a position to this transform and return the result.
public bool AlmostEqual(Transform tx, float delta = 0.0001)
Returns true if we're nearly equal to the passed transform.
Parameters
tx: The value to compare withdelta: The max difference between component values (used for Position and Scale) Default: 0.0001
Returns
True if nearly equal
public static Transform Concat(Transform parent, Transform local)
Concatenate (add together) the 2 given transforms and return a new resulting transform.
public static Transform Lerp(Transform a, Transform b, float t, bool clamp)
Perform linear interpolation from one transform to another.
public Transform LerpTo(Transform target, float t, bool clamp = True)
Linearly interpolate from this transform to given transform.
Parameters
clamp: Default: True
public static Transform Parse(string str)
Given a string, try to convert this into a transform. The format is `"px,py,pz,rx,ry,rz,rw"`.
public Vector3 PointToLocal(Vector3 worldPoint)
Convert a point in world space to a point in this transform's local space
public Vector3 PointToWorld(Vector3 localPoint)
Convert a point in this transform's local space to a point in world space
public Transform RotateAround(Vector3 center, Rotation rot)
Rotate this transform around given point by given rotation and return the result.
Parameters
center: Point to rotate around.rot: How much to rotate by. `Rotation.FromAxis(Vector3,System.Single)` can be useful.
Returns
The rotated transform.
public Transform ToLocal(Transform child)
Convert child transform from the world to a local transform
No results match this filter.
Properties
Showing 9 properties
public Ray Transform.ForwardRay { get; set; }
Return a ray from this transform, which goes from the center along the Forward
public bool Transform.IsValid { get; set; }
Returns true if position, scale and rotation are valid
public float Transform.UniformScale { get; set; }
A uniform scale component. Generally the scale is uniform, and we'll just access the .x component.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | global |
| Type | class |
| Assembly | Sandbox.System |
| Doc ID | T:Transform |