> 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.kscylindercollider.md).

# Class ksCylinderCollider

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

Cylinder collider component.

```csharp
[AddComponentMenu("Physics/Cylinder Collider", -1)]
public class ksCylinderCollider : MonoBehaviour, ksIUnityCollider, ksICollider
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← Object ← Component ← Behaviour ← MonoBehaviour ← [ksCylinderCollider](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kscylindercollider.md)

#### Implements

[ksIUnityCollider](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksiunitycollider.md), [ksICollider](/reactor/api-reference/ks.reactor/ks.reactor.ksicollider.md)

#### Inherited Members

MonoBehaviour.IsInvoking(), MonoBehaviour.CancelInvoke(), MonoBehaviour.Invoke(string, float), MonoBehaviour.InvokeRepeating(string, float, float), MonoBehaviour.CancelInvoke(string), MonoBehaviour.IsInvoking(string), MonoBehaviour.StartCoroutine(string), MonoBehaviour.StartCoroutine(string, object), MonoBehaviour.StartCoroutine(IEnumerator), MonoBehaviour.StartCoroutine\_Auto(IEnumerator), MonoBehaviour.StopCoroutine(IEnumerator), MonoBehaviour.StopCoroutine(Coroutine), MonoBehaviour.StopCoroutine(string), MonoBehaviour.StopAllCoroutines(), MonoBehaviour.print(object), MonoBehaviour.destroyCancellationToken, MonoBehaviour.useGUILayout, MonoBehaviour.runInEditMode, Behaviour.enabled, Behaviour.isActiveAndEnabled, Component.GetComponent(Type), Component.GetComponent\<T>(), Component.TryGetComponent(Type, out Component), Component.TryGetComponent\<T>(out T), Component.GetComponent(string), Component.GetComponentInChildren(Type, bool), Component.GetComponentInChildren(Type), Component.GetComponentInChildren\<T>(bool), Component.GetComponentInChildren\<T>(), Component.GetComponentsInChildren(Type, bool), Component.GetComponentsInChildren(Type), Component.GetComponentsInChildren\<T>(bool), Component.GetComponentsInChildren\<T>(bool, List\<T>), Component.GetComponentsInChildren\<T>(), Component.GetComponentsInChildren\<T>(List\<T>), Component.GetComponentInParent(Type, bool), Component.GetComponentInParent(Type), Component.GetComponentInParent\<T>(bool), Component.GetComponentInParent\<T>(), Component.GetComponentsInParent(Type, bool), Component.GetComponentsInParent(Type), Component.GetComponentsInParent\<T>(bool), Component.GetComponentsInParent\<T>(bool, List\<T>), Component.GetComponentsInParent\<T>(), Component.GetComponents(Type), Component.GetComponents(Type, List\<Component>), Component.GetComponents\<T>(List\<T>), Component.GetComponents\<T>(), Component.CompareTag(string), Component.SendMessageUpwards(string, object, SendMessageOptions), Component.SendMessageUpwards(string, object), Component.SendMessageUpwards(string), Component.SendMessageUpwards(string, SendMessageOptions), Component.SendMessage(string, object), Component.SendMessage(string), Component.SendMessage(string, object, SendMessageOptions), Component.SendMessage(string, SendMessageOptions), Component.BroadcastMessage(string, object, SendMessageOptions), Component.BroadcastMessage(string, object), Component.BroadcastMessage(string), Component.BroadcastMessage(string, SendMessageOptions), Component.transform, Component.gameObject, Component.tag, Object.GetInstanceID(), Object.GetHashCode(), Object.Equals(object), Object.Instantiate(Object, Vector3, Quaternion), Object.Instantiate(Object, Vector3, Quaternion, Transform), Object.Instantiate(Object), Object.Instantiate(Object, Transform), Object.Instantiate(Object, Transform, bool), Object.Instantiate\<T>(T), Object.Instantiate\<T>(T, Vector3, Quaternion), Object.Instantiate\<T>(T, Vector3, Quaternion, Transform), Object.Instantiate\<T>(T, Transform), Object.Instantiate\<T>(T, Transform, bool), Object.Destroy(Object, float), Object.Destroy(Object), Object.DestroyImmediate(Object, bool), Object.DestroyImmediate(Object), Object.FindObjectsOfType(Type), Object.FindObjectsOfType(Type, bool), Object.FindObjectsByType(Type, FindObjectsSortMode), Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode), Object.DontDestroyOnLoad(Object), Object.DestroyObject(Object, float), Object.DestroyObject(Object), Object.FindSceneObjectsOfType(Type), Object.FindObjectsOfTypeIncludingAssets(Type), Object.FindObjectsOfType\<T>(), Object.FindObjectsByType\<T>(FindObjectsSortMode), Object.FindObjectsOfType\<T>(bool), Object.FindObjectsByType\<T>(FindObjectsInactive, FindObjectsSortMode), Object.FindObjectOfType\<T>(), Object.FindObjectOfType\<T>(bool), Object.FindFirstObjectByType\<T>(), Object.FindAnyObjectByType\<T>(), Object.FindFirstObjectByType\<T>(FindObjectsInactive), Object.FindAnyObjectByType\<T>(FindObjectsInactive), Object.FindObjectsOfTypeAll(Type), Object.FindObjectOfType(Type), Object.FindFirstObjectByType(Type), Object.FindAnyObjectByType(Type), Object.FindObjectOfType(Type, bool), Object.FindFirstObjectByType(Type, FindObjectsInactive), Object.FindAnyObjectByType(Type, FindObjectsInactive), Object.ToString(), Object.name, Object.hideFlags, [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)

## Properties

### Bounds <a href="#ks_reactor_client_unity_kscylindercollider_bounds" id="ks_reactor_client_unity_kscylindercollider_bounds"></a>

Get the bounds of a collider at the position of it attached entity.

```csharp
public ksBounds Bounds { get; }
```

#### Property Value

[ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

### Center <a href="#ks_reactor_client_unity_kscylindercollider_center" id="ks_reactor_client_unity_kscylindercollider_center"></a>

Collider center relative to the entity position.

```csharp
public Vector3 Center { get; set; }
```

#### Property Value

Vector3

### Collider <a href="#ks_reactor_client_unity_kscylindercollider_collider" id="ks_reactor_client_unity_kscylindercollider_collider"></a>

The collider associated with the component.

```csharp
public Collider Collider { get; }
```

#### Property Value

Collider

### CollisionFilter <a href="#ks_reactor_client_unity_kscylindercollider_collisionfilter" id="ks_reactor_client_unity_kscylindercollider_collisionfilter"></a>

Get/Set the collision filter on the collider.

```csharp
public ksCollisionFilter CollisionFilter { get; set; }
```

#### Property Value

[ksCollisionFilter](/reactor/api-reference/ks.reactor/ks.reactor.kscollisionfilter.md)

### Component <a href="#ks_reactor_client_unity_kscylindercollider_component" id="ks_reactor_client_unity_kscylindercollider_component"></a>

The component this interface is for.

```csharp
public Component Component { get; }
```

#### Property Value

Component

### ContactOffset <a href="#ks_reactor_client_unity_kscylindercollider_contactoffset" id="ks_reactor_client_unity_kscylindercollider_contactoffset"></a>

Get/Set contact offset on a collider

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

#### Property Value

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

### Data <a href="#ks_reactor_client_unity_kscylindercollider_data" id="ks_reactor_client_unity_kscylindercollider_data"></a>

The collider data.

```csharp
public ksColliderData Data { get; }
```

#### Property Value

[ksColliderData](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kscolliderdata.md)

### Direction <a href="#ks_reactor_client_unity_kscylindercollider_direction" id="ks_reactor_client_unity_kscylindercollider_direction"></a>

Axis alignment

```csharp
public ksShape.Axis Direction { get; set; }
```

#### Property Value

[ksShape](/reactor/api-reference/ks.reactor/ks.reactor.ksshape.md).[Axis](/reactor/api-reference/ks.reactor/ks.reactor.ksshape/ks.reactor.ksshape.axis.md)

### Entity <a href="#ks_reactor_client_unity_kscylindercollider_entity" id="ks_reactor_client_unity_kscylindercollider_entity"></a>

Get the entity this collider is attached to.

```csharp
public ksIEntity Entity { get; }
```

#### Property Value

[ksIEntity](/reactor/api-reference/ks.reactor/ks.reactor.ksientity.md)

### Existance <a href="#ks_reactor_client_unity_kscylindercollider_existance" id="ks_reactor_client_unity_kscylindercollider_existance"></a>

Does this collider exist on the client, server, or both? Note that this only affects whether or not the collider is written to server configs during publishing or whether the collider is deleted on the client when the entity is spawned and may not be indicative of the current existance of the collider on the server at runtime.

```csharp
public ksExistenceModes Existance { get; }
```

#### Property Value

[ksExistenceModes](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksexistencemodes.md)

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

Cylinder height

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

#### Property Value

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

### IsEnabled <a href="#ks_reactor_client_unity_kscylindercollider_isenabled" id="ks_reactor_client_unity_kscylindercollider_isenabled"></a>

Get/Set the enabled state of a collider

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

#### Property Value

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

### IsQueryCollider <a href="#ks_reactor_client_unity_kscylindercollider_isquerycollider" id="ks_reactor_client_unity_kscylindercollider_isquerycollider"></a>

Get/Set if this collider is used in scene queries.

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

#### Property Value

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

### IsSimulationCollider <a href="#ks_reactor_client_unity_kscylindercollider_issimulationcollider" id="ks_reactor_client_unity_kscylindercollider_issimulationcollider"></a>

Get/Set if this collider is used in physics simulations.

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

#### Property Value

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

### IsTrigger <a href="#ks_reactor_client_unity_kscylindercollider_istrigger" id="ks_reactor_client_unity_kscylindercollider_istrigger"></a>

Get/Set if this collider is a trigger.

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

#### Property Value

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

### Material <a href="#ks_reactor_client_unity_kscylindercollider_material" id="ks_reactor_client_unity_kscylindercollider_material"></a>

Physics material

```csharp
public PhysicMaterial Material { get; set; }
```

#### Property Value

PhysicMaterial

### NumSides <a href="#ks_reactor_client_unity_kscylindercollider_numsides" id="ks_reactor_client_unity_kscylindercollider_numsides"></a>

Number of sides on the mesh appoximation.

```csharp
public int NumSides { get; set; }
```

#### Property Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

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

Cylinder radius

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

#### Property Value

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

### ShapeType <a href="#ks_reactor_client_unity_kscylindercollider_shapetype" id="ks_reactor_client_unity_kscylindercollider_shapetype"></a>

Get the collider shape type.

```csharp
public ksShape.ShapeTypes ShapeType { get; }
```

#### Property Value

[ksShape](/reactor/api-reference/ks.reactor/ks.reactor.ksshape.md).[ShapeTypes](/reactor/api-reference/ks.reactor/ks.reactor.ksshape/ks.reactor.ksshape.shapetypes.md)

## Methods

### GeometricCenter() <a href="#ks_reactor_client_unity_kscylindercollider_geometriccenter" id="ks_reactor_client_unity_kscylindercollider_geometriccenter"></a>

The geometric center of the cylinder in local space.

```csharp
public Vector3 GeometricCenter()
```

#### Returns

Vector3

Geometric center

### IsGeometryEqual(ksIUnityCollider) <a href="#ks_reactor_client_unity_kscylindercollider_isgeometryequal_ks_reactor_client_unity_ksiunitycollider" id="ks_reactor_client_unity_kscylindercollider_isgeometryequal_ks_reactor_client_unity_ksiunitycollider"></a>

Compare the geometry sources of each collider and return true if they are equal.

```csharp
public bool IsGeometryEqual(ksIUnityCollider other)
```

#### Parameters

`other` [ksIUnityCollider](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksiunitycollider.md)

Collider to compare to.

#### Returns

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

True if the collider geometry is equal.

### OnDestroy() <a href="#ks_reactor_client_unity_kscylindercollider_ondestroy" id="ks_reactor_client_unity_kscylindercollider_ondestroy"></a>

Called when this script is detached. Removes the hidden child object with generated collision mesh and the collider data.

```csharp
public void OnDestroy()
```

### Serialize() <a href="#ks_reactor_client_unity_kscylindercollider_serialize" id="ks_reactor_client_unity_kscylindercollider_serialize"></a>

Serializes the cylinder collider by generating convex hull vertices.

```csharp
public byte[] Serialize()
```

#### Returns

[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

Serialized geometry

### Start() <a href="#ks_reactor_client_unity_kscylindercollider_start" id="ks_reactor_client_unity_kscylindercollider_start"></a>

Unity start method. Generates a collision mesh and attaches it to a hidden child object.

```csharp
public void Start()
```

### Volume() <a href="#ks_reactor_client_unity_kscylindercollider_volume" id="ks_reactor_client_unity_kscylindercollider_volume"></a>

Volume of the cylinder.

```csharp
public float Volume()
```

#### Returns

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

Volume
