> 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.client.unity/ks.reactor.client.unity.ksunitycharactercontroller.md).

# Class ksUnityCharacterController

Namespace: [KS.Reactor.Client.Unity](/reactor/api-reference/ks.reactor.client.unity.md)\
Assembly: KSUnity-Source.dll

Class that wraps a Unity character controller and implements the ksICharacterController interface.

```csharp
public class ksUnityCharacterController : ksICharacterController
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksUnityCharacterController](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksunitycharactercontroller.md)

#### Implements

[ksICharacterController](/reactor/api-reference/ks.reactor/ks.reactor.ksicharactercontroller.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)

## Constructors

### ksUnityCharacterController(ksEntity, CharacterController) <a href="#ks_reactor_client_unity_ksunitycharactercontroller__ctor_ks_reactor_client_unity_ksentity_unityengin" id="ks_reactor_client_unity_ksunitycharactercontroller__ctor_ks_reactor_client_unity_ksentity_unityengin"></a>

Constructor

```csharp
public ksUnityCharacterController(ksEntity entity, CharacterController characterController)
```

#### Parameters

`entity` [ksEntity](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksentity.md)

Entity the character controller attached to

`characterController` CharacterController

Unity character controller component

## Properties

### CollisionFlags <a href="#ks_reactor_client_unity_ksunitycharactercontroller_collisionflags" id="ks_reactor_client_unity_ksunitycharactercontroller_collisionflags"></a>

What part of the capsule collided with the environment during the last CharacterController.Move call.

```csharp
public ksCharacterControllerCollisionFlags CollisionFlags { get; }
```

#### Property Value

[ksCharacterControllerCollisionFlags](/reactor/api-reference/ks.reactor/ks.reactor.kscharactercontrollercollisionflags.md)

### DetectCollisions <a href="#ks_reactor_client_unity_ksunitycharactercontroller_detectcollisions" id="ks_reactor_client_unity_ksunitycharactercontroller_detectcollisions"></a>

Determines whether other rigidbodies or character controllers collide with this character controller.

```csharp
public bool DetectCollisions { get; set; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### EnableOverlapRecovery <a href="#ks_reactor_client_unity_ksunitycharactercontroller_enableoverlaprecovery" id="ks_reactor_client_unity_ksunitycharactercontroller_enableoverlaprecovery"></a>

Enables or disables overlap recovery. Used to depenetrate character controllers from static objects when an overlap is detected.

```csharp
public bool EnableOverlapRecovery { get; set; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### Height <a href="#ks_reactor_client_unity_ksunitycharactercontroller_height" id="ks_reactor_client_unity_ksunitycharactercontroller_height"></a>

The height of the character's capsule.

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

#### Property Value

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

### IsGrounded <a href="#ks_reactor_client_unity_ksunitycharactercontroller_isgrounded" id="ks_reactor_client_unity_ksunitycharactercontroller_isgrounded"></a>

Was the CharacterController touching the ground during the last move?

```csharp
public bool IsGrounded { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### MinMoveDistance <a href="#ks_reactor_client_unity_ksunitycharactercontroller_minmovedistance" id="ks_reactor_client_unity_ksunitycharactercontroller_minmovedistance"></a>

Gets or sets the minimum move distance of the character controller.

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

#### Property Value

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

### Offset <a href="#ks_reactor_client_unity_ksunitycharactercontroller_offset" id="ks_reactor_client_unity_ksunitycharactercontroller_offset"></a>

The offset of the character's capsule relative to the transform's position.

```csharp
public ksVector3 Offset { get; set; }
```

#### Property Value

[ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

### Radius <a href="#ks_reactor_client_unity_ksunitycharactercontroller_radius" id="ks_reactor_client_unity_ksunitycharactercontroller_radius"></a>

The radius of the character's capsule.

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

#### Property Value

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

### SkinWidth <a href="#ks_reactor_client_unity_ksunitycharactercontroller_skinwidth" id="ks_reactor_client_unity_ksunitycharactercontroller_skinwidth"></a>

Collision skin width.

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

#### Property Value

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

### SlopeLimit <a href="#ks_reactor_client_unity_ksunitycharactercontroller_slopelimit" id="ks_reactor_client_unity_ksunitycharactercontroller_slopelimit"></a>

Slope limit in degrees.

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

#### Property Value

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

### StepOffset <a href="#ks_reactor_client_unity_ksunitycharactercontroller_stepoffset" id="ks_reactor_client_unity_ksunitycharactercontroller_stepoffset"></a>

Step offset in meters.

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

#### Property Value

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

### UnityCharacterController <a href="#ks_reactor_client_unity_ksunitycharactercontroller_unitycharactercontroller" id="ks_reactor_client_unity_ksunitycharactercontroller_unitycharactercontroller"></a>

Unity character controller.

```csharp
public CharacterController UnityCharacterController { get; }
```

#### Property Value

CharacterController

### Velocity <a href="#ks_reactor_client_unity_ksunitycharactercontroller_velocity" id="ks_reactor_client_unity_ksunitycharactercontroller_velocity"></a>

The current relative velocity of the character.

```csharp
public ksVector3 Velocity { get; }
```

#### Property Value

[ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

## Methods

### Move(ksVector3) <a href="#ks_reactor_client_unity_ksunitycharactercontroller_move_ks_reactor_ksvector3" id="ks_reactor_client_unity_ksunitycharactercontroller_move_ks_reactor_ksvector3"></a>

Moves the character with a displacement vector. Users are responsible for applying gravity to characters.

```csharp
public ksCharacterControllerCollisionFlags Move(ksVector3 motion)
```

#### Parameters

`motion` [ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

#### Returns

[ksCharacterControllerCollisionFlags](/reactor/api-reference/ks.reactor/ks.reactor.kscharactercontrollercollisionflags.md)

### SimpleMove(ksVector3) <a href="#ks_reactor_client_unity_ksunitycharactercontroller_simplemove_ks_reactor_ksvector3" id="ks_reactor_client_unity_ksunitycharactercontroller_simplemove_ks_reactor_ksvector3"></a>

Moves the character with velocity. Gravity is automatically applied. Returns if the character is grounded.

```csharp
public bool SimpleMove(ksVector3 velocity)
```

#### Parameters

`velocity` [ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the character is grounded.

### Teleport(Vector3) <a href="#ks_reactor_client_unity_ksunitycharactercontroller_teleport_unityengine_vector3" id="ks_reactor_client_unity_ksunitycharactercontroller_teleport_unityengine_vector3"></a>

Teleports to the given position.

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

#### Parameters

`position` Vector3

Position to teleport to.

### OnColliderHit <a href="#ks_reactor_client_unity_ksunitycharactercontroller_oncolliderhit" id="ks_reactor_client_unity_ksunitycharactercontroller_oncolliderhit"></a>

Invoked when this character controller hit a collider.

```csharp
public event ksCharacterControllerEvents.ColliderHitHandler OnColliderHit
```

#### Event Type

[ksCharacterControllerEvents](/reactor/api-reference/ks.reactor/ks.reactor.kscharactercontrollerevents.md).[ColliderHitHandler](/reactor/api-reference/ks.reactor/ks.reactor.kscharactercontrollerevents/ks.reactor.kscharactercontrollerevents.colliderhithandler.md)
