> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor/ks.reactor.kstransform2d.md).

# Class ksTransform2D

Namespace: [KS.Reactor](/reactor/api-reference/ks.reactor.md)\
Assembly: KSCommon.dll

Transform with methods for moving entities in 2 dimensions. There are two kinds of movement: teleportation and moving. Moving will test for collisions along the way and teleportation will not. If you make more than one move call in a frame, the collision check will be along a straight path from the position at the start of the frame to the end position. You cannot do a move and a teleport in the same frame. If you make both calls the entity will teleport.

```csharp
public class ksTransform2D : ksIReadOnlyTransform2D
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksTransform2D](/reactor/api-reference/ks.reactor/ks.reactor.kstransform2d.md)

#### Implements

[ksIReadOnlyTransform2D](/reactor/api-reference/ks.reactor/ks.reactor.ksireadonlytransform2d.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

#### Extension Methods

[ksReadOnlyTransform2DExtension.Backwards(ksIReadOnlyTransform2D)](/reactor/api-reference/ks.reactor/ks.reactor.ksreadonlytransform2dextension.md#KS_Reactor_ksReadOnlyTransform2DExtension_Backwards_KS_Reactor_ksIReadOnlyTransform2D_), [ksReadOnlyTransform2DExtension.Forward(ksIReadOnlyTransform2D)](/reactor/api-reference/ks.reactor/ks.reactor.ksreadonlytransform2dextension.md#KS_Reactor_ksReadOnlyTransform2DExtension_Forward_KS_Reactor_ksIReadOnlyTransform2D_), [ksReadOnlyTransform2DExtension.Left(ksIReadOnlyTransform2D)](/reactor/api-reference/ks.reactor/ks.reactor.ksreadonlytransform2dextension.md#KS_Reactor_ksReadOnlyTransform2DExtension_Left_KS_Reactor_ksIReadOnlyTransform2D_), [ksReadOnlyTransform2DExtension.Right(ksIReadOnlyTransform2D)](/reactor/api-reference/ks.reactor/ks.reactor.ksreadonlytransform2dextension.md#KS_Reactor_ksReadOnlyTransform2DExtension_Right_KS_Reactor_ksIReadOnlyTransform2D_), [ksReadOnlyTransform2DExtension.ToLocal(ksIReadOnlyTransform2D, ksVector2)](/reactor/api-reference/ks.reactor/ks.reactor.ksreadonlytransform2dextension.md#KS_Reactor_ksReadOnlyTransform2DExtension_ToLocal_KS_Reactor_ksIReadOnlyTransform2D_KS_Reactor_ksVector2_), [ksReadOnlyTransform2DExtension.ToWorld(ksIReadOnlyTransform2D, ksVector2)](/reactor/api-reference/ks.reactor/ks.reactor.ksreadonlytransform2dextension.md#KS_Reactor_ksReadOnlyTransform2DExtension_ToWorld_KS_Reactor_ksIReadOnlyTransform2D_KS_Reactor_ksVector2_)

## Properties

### Position <a href="#ks_reactor_kstransform2d_position" id="ks_reactor_kstransform2d_position"></a>

Position.

```csharp
public ksVector2 Position { get; set; }
```

#### Property Value

[ksVector2](/reactor/api-reference/ks.reactor/ks.reactor.ksvector2.md)

### Rotation <a href="#ks_reactor_kstransform2d_rotation" id="ks_reactor_kstransform2d_rotation"></a>

Rotation in degrees.

```csharp
public float Rotation { get; set; }
```

#### Property Value

[float](https://learn.microsoft.com/dotnet/api/system.single)

### RotationRadians <a href="#ks_reactor_kstransform2d_rotationradians" id="ks_reactor_kstransform2d_rotationradians"></a>

Rotation in radians.

```csharp
public float RotationRadians { get; set; }
```

#### Property Value

[float](https://learn.microsoft.com/dotnet/api/system.single)

### Scale <a href="#ks_reactor_kstransform2d_scale" id="ks_reactor_kstransform2d_scale"></a>

Scale.

```csharp
public ksVector2 Scale { get; set; }
```

#### Property Value

[ksVector2](/reactor/api-reference/ks.reactor/ks.reactor.ksvector2.md)

## Methods

### LookAt(ksVector2) <a href="#ks_reactor_kstransform2d_lookat_ks_reactor_ksvector2" id="ks_reactor_kstransform2d_lookat_ks_reactor_ksvector2"></a>

Rotates the transform to look at a position.

```csharp
public void LookAt(ksVector2 position)
```

#### Parameters

`position` [ksVector2](/reactor/api-reference/ks.reactor/ks.reactor.ksvector2.md)

Position in world space to look at.

### Move(ksVector2) <a href="#ks_reactor_kstransform2d_move_ks_reactor_ksvector2" id="ks_reactor_kstransform2d_move_ks_reactor_ksvector2"></a>

Adds a delta to the transform position.

```csharp
public void Move(ksVector2 delta)
```

#### Parameters

`delta` [ksVector2](/reactor/api-reference/ks.reactor/ks.reactor.ksvector2.md)

Delta to add to position.

### MoveTo(ksVector2) <a href="#ks_reactor_kstransform2d_moveto_ks_reactor_ksvector2" id="ks_reactor_kstransform2d_moveto_ks_reactor_ksvector2"></a>

Moves the entity to a new position.

```csharp
public void MoveTo(ksVector2 position)
```

#### Parameters

`position` [ksVector2](/reactor/api-reference/ks.reactor/ks.reactor.ksvector2.md)

Position to move to.

### MoveTowards(ksVector2, float) <a href="#ks_reactor_kstransform2d_movetowards_ks_reactor_ksvector2_system_single" id="ks_reactor_kstransform2d_movetowards_ks_reactor_ksvector2_system_single"></a>

Moves the transform towards a position.

```csharp
public void MoveTowards(ksVector2 position, float delta)
```

#### Parameters

`position` [ksVector2](/reactor/api-reference/ks.reactor/ks.reactor.ksvector2.md)

Target to move towards.

`delta` [float](https://learn.microsoft.com/dotnet/api/system.single)

Delta to move by. It will not overshoot the target. Negative values will move away from the target.

### Rotate(float) <a href="#ks_reactor_kstransform2d_rotate_system_single" id="ks_reactor_kstransform2d_rotate_system_single"></a>

Rotates the transform.

```csharp
public void Rotate(float rotation)
```

#### Parameters

`rotation` [float](https://learn.microsoft.com/dotnet/api/system.single)

Rotation to add in degrees.

### RotateRadians(float) <a href="#ks_reactor_kstransform2d_rotateradians_system_single" id="ks_reactor_kstransform2d_rotateradians_system_single"></a>

Rotates the transform.

```csharp
public void RotateRadians(float rotation)
```

#### Parameters

`rotation` [float](https://learn.microsoft.com/dotnet/api/system.single)

Rotation to add in radians.

### RotateTo(float) <a href="#ks_reactor_kstransform2d_rotateto_system_single" id="ks_reactor_kstransform2d_rotateto_system_single"></a>

Sets the rotation.

```csharp
public void RotateTo(float rotation)
```

#### Parameters

`rotation` [float](https://learn.microsoft.com/dotnet/api/system.single)

Rotation in degrees.

### RotateToRadians(float) <a href="#ks_reactor_kstransform2d_rotatetoradians_system_single" id="ks_reactor_kstransform2d_rotatetoradians_system_single"></a>

Sets the rotation.

```csharp
public void RotateToRadians(float rotation)
```

#### Parameters

`rotation` [float](https://learn.microsoft.com/dotnet/api/system.single)

Rotation in radians.

### RotateTowards(float, float) <a href="#ks_reactor_kstransform2d_rotatetowards_system_single_system_single" id="ks_reactor_kstransform2d_rotatetowards_system_single_system_single"></a>

Rotates the transform towards a rotation.

```csharp
public void RotateTowards(float target, float deltaAngle)
```

#### Parameters

`target` [float](https://learn.microsoft.com/dotnet/api/system.single)

Target angle to rotate towards in degrees.

`deltaAngle` [float](https://learn.microsoft.com/dotnet/api/system.single)

Delta angle in degrees to rotate. It will not overshoot the target. Negative values will rotate away from the target.

### RotateTowards(ksVector2, float) <a href="#ks_reactor_kstransform2d_rotatetowards_ks_reactor_ksvector2_system_single" id="ks_reactor_kstransform2d_rotatetowards_ks_reactor_ksvector2_system_single"></a>

Rotates the transform towards a position.

```csharp
public void RotateTowards(ksVector2 position, float deltaAngle)
```

#### Parameters

`position` [ksVector2](/reactor/api-reference/ks.reactor/ks.reactor.ksvector2.md)

Position in world space to rotate towards.

`deltaAngle` [float](https://learn.microsoft.com/dotnet/api/system.single)

Delta angle in degrees to rotate. It will not overshoot the target. Negative values will rotate away from the target.

### RotateTowardsRadians(float, float) <a href="#ks_reactor_kstransform2d_rotatetowardsradians_system_single_system_single" id="ks_reactor_kstransform2d_rotatetowardsradians_system_single_system_single"></a>

Rotates the transform towards a rotation.

```csharp
public void RotateTowardsRadians(float target, float deltaAngle)
```

#### Parameters

`target` [float](https://learn.microsoft.com/dotnet/api/system.single)

Target angle to rotate towards in radians.

`deltaAngle` [float](https://learn.microsoft.com/dotnet/api/system.single)

Delta angle in radians to rotate. It will not overshoot the target. Negative values will rotate away from the target.

### RotateTowardsRadians(ksVector2, float) <a href="#ks_reactor_kstransform2d_rotatetowardsradians_ks_reactor_ksvector2_system_single" id="ks_reactor_kstransform2d_rotatetowardsradians_ks_reactor_ksvector2_system_single"></a>

Rotates the transform towards a position.

```csharp
public void RotateTowardsRadians(ksVector2 position, float deltaAngle)
```

#### Parameters

`position` [ksVector2](/reactor/api-reference/ks.reactor/ks.reactor.ksvector2.md)

Position in world space to rotate towards.

`deltaAngle` [float](https://learn.microsoft.com/dotnet/api/system.single)

Delta angle in radians to rotate. It will not overshoot the target. Negative values will rotate away from the target.

### ScaleTo(ksVector2) <a href="#ks_reactor_kstransform2d_scaleto_ks_reactor_ksvector2" id="ks_reactor_kstransform2d_scaleto_ks_reactor_ksvector2"></a>

Sets the scale.

```csharp
public void ScaleTo(ksVector2 scale)
```

#### Parameters

`scale` [ksVector2](/reactor/api-reference/ks.reactor/ks.reactor.ksvector2.md)

### Teleport(ksVector2) <a href="#ks_reactor_kstransform2d_teleport_ks_reactor_ksvector2" id="ks_reactor_kstransform2d_teleport_ks_reactor_ksvector2"></a>

Teleports the entity to a location.

```csharp
public void Teleport(ksVector2 position)
```

#### Parameters

`position` [ksVector2](/reactor/api-reference/ks.reactor/ks.reactor.ksvector2.md)

Position to teleport to.
