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

# Class ksEntityComponent

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

Attach this to your GameObjects to make the server aware of them when you publish your scene.

```csharp
[ksHideInOwnershipManager(true)]
[DisallowMultipleComponent]
[AddComponentMenu("Reactor/ksEntityComponent")]
public class ksEntityComponent : ksScriptsComponent<ksEntity, ksEntityScript>
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† Object â† Component â† Behaviour â† MonoBehaviour â† [ksScriptsComponent\<ksEntity, ksEntityScript>](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksscriptscomponent-2.md) â† [ksEntityComponent](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksentitycomponent.md)

#### Inherited Members

[ksScriptsComponent\<ksEntity, ksEntityScript>.PreAttachScripts](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksscriptscomponent-2.md#KS_Reactor_Client_Unity_ksScriptsComponent_2_PreAttachScripts), [ksScriptsComponent\<ksEntity, ksEntityScript>.ParentObject](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksscriptscomponent-2.md#KS_Reactor_Client_Unity_ksScriptsComponent_2_ParentObject), [ksScriptsComponent\<ksEntity, ksEntityScript>.Scripts](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksscriptscomponent-2.md#KS_Reactor_Client_Unity_ksScriptsComponent_2_Scripts), [ksScriptsComponent\<ksEntity, ksEntityScript>.ScriptsAttached](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksscriptscomponent-2.md#KS_Reactor_Client_Unity_ksScriptsComponent_2_ScriptsAttached), [ksScriptsComponent\<ksEntity, ksEntityScript>.IsInitialized](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksscriptscomponent-2.md#KS_Reactor_Client_Unity_ksScriptsComponent_2_IsInitialized), [ksScriptsComponent\<ksEntity, ksEntityScript>.OnDestroy()](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksscriptscomponent-2.md#KS_Reactor_Client_Unity_ksScriptsComponent_2_OnDestroy), 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)

## Fields

### AssetId <a href="#ks_reactor_client_unity_ksentitycomponent_assetid" id="ks_reactor_client_unity_ksentitycomponent_assetid"></a>

Asset Id

```csharp
public uint AssetId
```

#### Field Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

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

Collision filter for entity groups, notifications, and interactions.

```csharp
[Tooltip("Collision filter for entity groups, notifications, and interactions.")]
public ksCollisionFilterAsset CollisionFilter
```

#### Field Value

[ksCollisionFilterAsset](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kscollisionfilterasset.md)

### ControllerPredictor <a href="#ks_reactor_client_unity_ksentitycomponent_controllerpredictor" id="ks_reactor_client_unity_ksentitycomponent_controllerpredictor"></a>

Predictor to use when the entity has a player controller that uses input prediction. If [OverrideControllerPredictor](#KS_Reactor_Client_Unity_ksEntityComponent_OverrideControllerPredictor) is false, uses [DefaultEntityControllerPredictor](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksroomtype.md#KS_Reactor_Client_Unity_ksRoomType_DefaultEntityControllerPredictor) instead.

```csharp
[Tooltip("Predictor to use when the entity has a player controller that uses input prediction.(unchecked = use default room settings)")]
public ksPredictor ControllerPredictor
```

#### Field Value

[ksPredictor](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kspredictor.md)

### DestroyOnOwnerDisconnect <a href="#ks_reactor_client_unity_ksentitycomponent_destroyonownerdisconnect" id="ks_reactor_client_unity_ksentitycomponent_destroyonownerdisconnect"></a>

If true, the entity will be destroyed when its owner disconnects.

```csharp
[Tooltip("If true, the entity will be destroyed when its owner disconnects.")]
public bool DestroyOnOwnerDisconnect
```

#### Field Value

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

### DestroyWithServer <a href="#ks_reactor_client_unity_ksentitycomponent_destroywithserver" id="ks_reactor_client_unity_ksentitycomponent_destroywithserver"></a>

If true, the gameobject will be destroyed when the server destroys the entity or when [CleanUp](/reactor/api-reference/ks.reactor.client.md#KS_Reactor_Client_ksBaseRoom_602_CleanUp) is called after disconnecting. Not applicable for permanent entities. If false, you should call [CleanUp](#KS_Reactor_Client_Unity_ksEntityComponent_CleanUp) when you no longer need the game object to ensure it gets cleaned up properly.

```csharp
[Tooltip("If true, the gameobject will be destroyed when the server destroys the entity or when Room.CleanUp is called after disconnecting. If false, you should call ReleaseGameObject when you no longer need the game object to ensure it gets cleaned up properly")]
public bool DestroyWithServer
```

#### Field Value

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

### EntityId <a href="#ks_reactor_client_unity_ksentitycomponent_entityid" id="ks_reactor_client_unity_ksentitycomponent_entityid"></a>

Entity Id

```csharp
public uint EntityId
```

#### Field Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### IsStatic <a href="#ks_reactor_client_unity_ksentitycomponent_isstatic" id="ks_reactor_client_unity_ksentitycomponent_isstatic"></a>

Is Static

```csharp
[HideInInspector]
public bool IsStatic
```

#### Field Value

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

### OverrideControllerPredictor <a href="#ks_reactor_client_unity_ksentitycomponent_overridecontrollerpredictor" id="ks_reactor_client_unity_ksentitycomponent_overridecontrollerpredictor"></a>

If true, uses [ControllerPredictor](#KS_Reactor_Client_Unity_ksEntityComponent_ControllerPredictor) instead of the default from [DefaultEntityControllerPredictor](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksroomtype.md#KS_Reactor_Client_Unity_ksRoomType_DefaultEntityControllerPredictor).

```csharp
public bool OverrideControllerPredictor
```

#### Field Value

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

### OverridePredictor <a href="#ks_reactor_client_unity_ksentitycomponent_overridepredictor" id="ks_reactor_client_unity_ksentitycomponent_overridepredictor"></a>

If true, uses [Predictor](#KS_Reactor_Client_Unity_ksEntityComponent_Predictor) instead of the default from [DefaultEntityPredictor](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksroomtype.md#KS_Reactor_Client_Unity_ksRoomType_DefaultEntityPredictor).

```csharp
public bool OverridePredictor
```

#### Field Value

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

### PhysicsMaterial <a href="#ks_reactor_client_unity_ksentitycomponent_physicsmaterial" id="ks_reactor_client_unity_ksentitycomponent_physicsmaterial"></a>

The physics material for colliders on this entity to use if they do not have a material set.

```csharp
[Tooltip("The physics material for colliders on this entity to use if they do not have a material set.")]
public PhysicMaterial PhysicsMaterial
```

#### Field Value

PhysicMaterial

### PhysicsOverrides <a href="#ks_reactor_client_unity_ksentitycomponent_physicsoverrides" id="ks_reactor_client_unity_ksentitycomponent_physicsoverrides"></a>

Override room [ksPhysicsSettings](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksphysicssettings.md) per entity. A value of -1 means that the value in the room [ksPhysicsSettings](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksphysicssettings.md) will be used.

```csharp
[Tooltip("Override room phyiscs settings per entity. A value of -1 means that the value in the roomphysics settings will be used.")]
public ksEntityPhysicsSettings PhysicsOverrides
```

#### Field Value

[ksEntityPhysicsSettings](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksentityphysicssettings.md)

### Predictor <a href="#ks_reactor_client_unity_ksentitycomponent_predictor" id="ks_reactor_client_unity_ksentitycomponent_predictor"></a>

Predictor to use when the entity does not have a player controller that uses input prediction. If [OverridePredictor](#KS_Reactor_Client_Unity_ksEntityComponent_OverridePredictor) is false, uses [DefaultEntityPredictor](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksroomtype.md#KS_Reactor_Client_Unity_ksRoomType_DefaultEntityPredictor) instead.

```csharp
[Tooltip("Predictor to use when the entity does not have a player controller that uses input prediction. (unchecked = use default room settings)")]
public ksPredictor Predictor
```

#### Field Value

[ksPredictor](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kspredictor.md)

### RigidBodyExistence <a href="#ks_reactor_client_unity_ksentitycomponent_rigidbodyexistence" id="ks_reactor_client_unity_ksentitycomponent_rigidbodyexistence"></a>

Does the Rigidbody exist on the client, server, or both?

```csharp
[HideInInspector]
[Tooltip("Does this rigid body exist on the client, server, or both?")]
[FormerlySerializedAs("RigidBodyExistance")]
public ksExistenceModes RigidBodyExistence
```

#### Field Value

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

### SyncGroup <a href="#ks_reactor_client_unity_ksentitycomponent_syncgroup" id="ks_reactor_client_unity_ksentitycomponent_syncgroup"></a>

```csharp
[Tooltip("Default sync group the entity will be placed in. This entity will not be synced to players who are not in the same sync group. Sync group 0 entities are always synced to all players.")]
[SerializeField]
public uint SyncGroup
```

#### Field Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### TransformPrecisionOverrides <a href="#ks_reactor_client_unity_ksentitycomponent_transformprecisionoverrides" id="ks_reactor_client_unity_ksentitycomponent_transformprecisionoverrides"></a>

Override the precision for this entity used when syncing transform data from servers to clients. A value of -1 means that the value in the [ksRoomType](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksroomtype.md) will be used.

```csharp
[Tooltip("Override the precision for this entity used when syncing transform data from servers to clients.")]
public ksTransformPrecisions TransformPrecisionOverrides
```

#### Field Value

[ksTransformPrecisions](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kstransformprecisions.md)

### Type <a href="#ks_reactor_client_unity_ksentitycomponent_type" id="ks_reactor_client_unity_ksentitycomponent_type"></a>

Entity Type

```csharp
[HideInInspector]
public string Type
```

#### Field Value

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

## Properties

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

Entity

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

#### Property Value

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

### Factory <a href="#ks_reactor_client_unity_ksentitycomponent_factory" id="ks_reactor_client_unity_ksentitycomponent_factory"></a>

Entity factory used to spawn this entity.

```csharp
public ksEntityFactory Factory { get; }
```

#### Property Value

[ksEntityFactory](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksentityfactory.md)

### IsInUse <a href="#ks_reactor_client_unity_ksentitycomponent_isinuse" id="ks_reactor_client_unity_ksentitycomponent_isinuse"></a>

Is this game object being used for an entity? Set to true when linked to an entity, and to false again when [CleanUp](#KS_Reactor_Client_Unity_ksEntityComponent_CleanUp) is called after the entity is destroyed.

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

#### Property Value

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

### IsPermanent <a href="#ks_reactor_client_unity_ksentitycomponent_ispermanent" id="ks_reactor_client_unity_ksentitycomponent_ispermanent"></a>

Is this a permanent entity? Permanent entities never move and cannot be deleted.

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

#### Property Value

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

### IsSceneEntity <a href="#ks_reactor_client_unity_ksentitycomponent_issceneentity" id="ks_reactor_client_unity_ksentitycomponent_issceneentity"></a>

Is this entity component part of the initial scene?

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

#### Property Value

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

## Methods

### CleanUp() <a href="#ks_reactor_client_unity_ksentitycomponent_cleanup" id="ks_reactor_client_unity_ksentitycomponent_cleanup"></a>

```csharp
public void CleanUp()
```

### DestroyCollider(Collider) <a href="#ks_reactor_client_unity_ksentitycomponent_destroycollider_unityengine_collider" id="ks_reactor_client_unity_ksentitycomponent_destroycollider_unityengine_collider"></a>

Destroys a collider and its associated [ksColliderData](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kscolliderdata.md).

```csharp
public void DestroyCollider(Collider collider)
```

#### Parameters

`collider` Collider

Collider to destroy

### DetectShapeType() <a href="#ks_reactor_client_unity_ksentitycomponent_detectshapetype" id="ks_reactor_client_unity_ksentitycomponent_detectshapetype"></a>

Detects the shape type of this entity.

```csharp
public ksShape.ShapeTypes DetectShapeType()
```

#### Returns

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

Shape type

### GetCollider(Component) <a href="#ks_reactor_client_unity_ksentitycomponent_getcollider_unityengine_component" id="ks_reactor_client_unity_ksentitycomponent_getcollider_unityengine_component"></a>

Converts a Unity component into a [ksIUnityCollider](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksiunitycollider.md).

```csharp
public ksIUnityCollider GetCollider(Component component)
```

#### Parameters

`component` Component

component to convert

#### Returns

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

Collider, or null if the component cannot be converted.

### GetCollider\<ColliderType>() <a href="#ks_reactor_client_unity_ksentitycomponent_getcollider__1" id="ks_reactor_client_unity_ksentitycomponent_getcollider__1"></a>

Gets the first enabled collider of the given type on an entity.

```csharp
public ColliderType GetCollider<ColliderType>() where ColliderType : Collider
```

#### Returns

ColliderType

First enabled collider of `ColliderType` on the entity, or null if none exist.

#### Type Parameters

`ColliderType`

Unity collider type.

### GetColliderData(Component, bool) <a href="#ks_reactor_client_unity_ksentitycomponent_getcolliderdata_unityengine_component_system_boolean" id="ks_reactor_client_unity_ksentitycomponent_getcolliderdata_unityengine_component_system_boolean"></a>

Get the collider data component for a collider. Optionally creates collider data is none is found and `collider` is one of the supported collider types.

```csharp
public ksColliderData GetColliderData(Component collider, bool create = true)
```

#### Parameters

`collider` Component

Collider to get collider data for.

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

True to create the collider data if it is not found and `collider` is one of the supported collider types.

#### Returns

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

Collider data for the collider. Null if the collider is not one of the supported types or `create` was false and none was found.

### GetColliders() <a href="#ks_reactor_client_unity_ksentitycomponent_getcolliders" id="ks_reactor_client_unity_ksentitycomponent_getcolliders"></a>

Gets all colliders on an entity that are supported by Reactor.

```csharp
public List<ksICollider> GetColliders()
```

#### Returns

[List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)<[ksICollider](/reactor/api-reference/ks.reactor/ks.reactor.ksicollider.md)>

List of colliders.

### GetCollisionFilter() <a href="#ks_reactor_client_unity_ksentitycomponent_getcollisionfilter" id="ks_reactor_client_unity_ksentitycomponent_getcollisionfilter"></a>

Determines which entities to collide with and notify of collision/overlap events.

```csharp
public ksCollisionFilter GetCollisionFilter()
```

#### Returns

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

### GetCollisionFilter(Component) <a href="#ks_reactor_client_unity_ksentitycomponent_getcollisionfilter_unityengine_component" id="ks_reactor_client_unity_ksentitycomponent_getcollisionfilter_unityengine_component"></a>

Gets the collision filter for a collider.

```csharp
public ksCollisionFilter GetCollisionFilter(Component collider)
```

#### Parameters

`collider` Component

Collider to get collision filter for.

#### Returns

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

Collision filter for the collider.

### GetCollisionFilterAsset(Component, bool) <a href="#ks_reactor_client_unity_ksentitycomponent_getcollisionfilterasset_unityengine_component_system_boole" id="ks_reactor_client_unity_ksentitycomponent_getcollisionfilterasset_unityengine_component_system_boole"></a>

Returns the collision filter for a collider.

```csharp
public ksCollisionFilterAsset GetCollisionFilterAsset(Component collider, bool defaultFromEntity = true)
```

#### Parameters

`collider` Component

Collider to get [ksCollisionFilterAsset](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kscollisionfilterasset.md) for.

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

If the collision filter for the collider isn't set, returns the filter from the entity if this is true, and null if this is false.

#### Returns

[ksCollisionFilterAsset](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.kscollisionfilterasset.md)

Collision filter assigned to the entity collider.

### GetMonoBehaviour\<MonobehaviourType>() <a href="#ks_reactor_client_unity_ksentitycomponent_getmonobehaviour__1" id="ks_reactor_client_unity_ksentitycomponent_getmonobehaviour__1"></a>

Gets the first enabled monobehaviour of the given type on an entity.

```csharp
public MonobehaviourType GetMonoBehaviour<MonobehaviourType>() where MonobehaviourType : MonoBehaviour
```

#### Returns

MonobehaviourType

First enabled collider of `MonobehaviourType` on the entity, or null if none exist.

#### Type Parameters

`MonobehaviourType`

Unity Monobehaviour type.

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

Called when the component is destroyed. If the entity was not destroyed, flags the entity as being deleted locally so a deletion request will be sent if the local player owns the entity with the destroy permision.

```csharp
protected override void OnDestroy()
```

### SetCollisionFilter(Component, ksCollisionFilter) <a href="#ks_reactor_client_unity_ksentitycomponent_setcollisionfilter_unityengine_component_ks_reactor_kscoll" id="ks_reactor_client_unity_ksentitycomponent_setcollisionfilter_unityengine_component_ks_reactor_kscoll"></a>

Set the collision filter for a collider.

```csharp
public void SetCollisionFilter(Component collider, ksCollisionFilter filter)
```

#### Parameters

`collider` Component

Collider to set the collision filter for.

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

Collision filter value
