# IKControl

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Memory category: Animation
- HTML page: https://rapi.sleaze.dev/classes/IKControl/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/IKControl

Specifies a control to generate a procedural animation pose using Inverse Kinematics.

## Properties

### ChainRoot

```luau
IKControl.ChainRoot: Instance
```

- Tags: Read capabilities: Animation, Simulation access

The last part that you are interested in moving your character. For example, the upper arm. Must be an ancestor of [`EndEffector`](https://rapi.sleaze.dev/classes/IKControl.md) and be a [`BasePart`](https://rapi.sleaze.dev/classes/BasePart.md) or a [`Bone`](https://rapi.sleaze.dev/classes/Bone.md) in your character.

### Enabled

```luau
IKControl.Enabled: boolean = true
```

- Tags: Read capabilities: Animation, Simulation access

Toggles the control on and off. True by default.

### EndEffector

```luau
IKControl.EndEffector: Instance
```

- Tags: Read capabilities: Animation, Simulation access

The part that you are interested in moving to reach the [`Target`](https://rapi.sleaze.dev/classes/IKControl.md). For example, the hand of your character. Must be a descendant of [`ChainRoot`](https://rapi.sleaze.dev/classes/IKControl.md) and be a [`BasePart`](https://rapi.sleaze.dev/classes/BasePart.md) or a [`Bone`](https://rapi.sleaze.dev/classes/Bone.md) in your character.

### EndEffectorOffset

```luau
IKControl.EndEffectorOffset: CFrame = CFrame.identity
```

- Tags: Read capabilities: Animation

An additional offset applied on top of the [`EndEffector`](https://rapi.sleaze.dev/classes/IKControl.md) in its local space to change where it moves.

### Offset

```luau
IKControl.Offset: CFrame = CFrame.identity
```

- Tags: Read capabilities: Animation

An additional offset applied on top of the [`Target`](https://rapi.sleaze.dev/classes/IKControl.md) to change where the [`EndEffector`](https://rapi.sleaze.dev/classes/IKControl.md) moves.

### Pole

```luau
IKControl.Pole: Instance
```

- Tags: Read capabilities: Animation

An optional instance that determines which way the chain bends. You can use this to specify which way an elbow or knee bends.

### Priority

```luau
IKControl.Priority: number = 0
```

- Tags: Read capabilities: Animation

Specifies the order in which controls are solved. Higher values have higher priority.

### SmoothTime

```luau
IKControl.SmoothTime: number = 0.0500000007
```

- Tags: Read capabilities: Animation

Specifies the average number of seconds that it takes for the [`EndEffector`](https://rapi.sleaze.dev/classes/IKControl.md) to smoothly reach the [`Target`](https://rapi.sleaze.dev/classes/IKControl.md).

### Target

```luau
IKControl.Target: Instance
```

- Tags: Read capabilities: Animation, Simulation access

The object that the [`EndEffector`](https://rapi.sleaze.dev/classes/IKControl.md) reaches for or points at. It can be anything that has a position in the world, such as [`BasePart`](https://rapi.sleaze.dev/classes/BasePart.md), [`Attachment`](https://rapi.sleaze.dev/classes/Attachment.md), [`Bone`](https://rapi.sleaze.dev/classes/Bone.md), or [`Motor6D`](https://rapi.sleaze.dev/classes/Motor6D.md).

### Type

```luau
IKControl.Type: Enum.IKControlType = Enum.IKControlType.Transform
```

- Tags: Read capabilities: Animation, Simulation access

Specifies how the solver satisfies this control.

### Weight

```luau
IKControl.Weight: number = 1
```

- Tags: Read capabilities: Animation, Simulation access

Specifies the weight of the IK control target. Should be in the [0, 1] range.

## Methods

### GetChainCount

```luau
IKControl:GetChainCount(): number
```

- Tags: Capabilities: Animation

Returns the number of segments in the IK chain between the [`ChainRoot`](https://rapi.sleaze.dev/classes/IKControl.md) and the [`EndEffector`](https://rapi.sleaze.dev/classes/IKControl.md).

Returns: The number of segments in the chain, or `0` if the chain isn't valid.

### GetChainLength

```luau
IKControl:GetChainLength(): number
```

- Tags: Capabilities: Animation

Returns the total length, in studs, of the IK chain between the [`ChainRoot`](https://rapi.sleaze.dev/classes/IKControl.md) and the [`EndEffector`](https://rapi.sleaze.dev/classes/IKControl.md).

Returns: The combined length of the chain in studs, or `0` if the chain isn't valid.

### GetNodeLocalCFrame

```luau
IKControl:GetNodeLocalCFrame(index: number): CFrame
```

- Tags: Capabilities: Animation

Returns the [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) of the chain node at the given index, relative to its parent node in the chain.

Parameters:

- `index`: The 1-based position of the node in the chain, from `1` (the [`ChainRoot`](https://rapi.sleaze.dev/classes/IKControl.md)) up to [`GetChainCount()`](https://rapi.sleaze.dev/classes/IKControl.md) plus `1` (the [`EndEffector`](https://rapi.sleaze.dev/classes/IKControl.md)).

Returns: The node's [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) in the local space of its parent node, or the identity [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) if the index is out of range or the chain hasn't been solved.

### GetNodeWorldCFrame

```luau
IKControl:GetNodeWorldCFrame(index: number): CFrame
```

- Tags: Capabilities: Animation

Returns the world-space [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) of the chain node at the given index.

Parameters:

- `index`: The 1-based position of the node in the chain, from `1` (the [`ChainRoot`](https://rapi.sleaze.dev/classes/IKControl.md)) up to [`GetChainCount()`](https://rapi.sleaze.dev/classes/IKControl.md) plus `1` (the [`EndEffector`](https://rapi.sleaze.dev/classes/IKControl.md)).

Returns: The node's world-space [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md), or the identity [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) if the index is out of range or the chain hasn't been solved.

### GetRawFinalTarget

```luau
IKControl:GetRawFinalTarget(): CFrame
```

- Tags: Capabilities: Animation

Returns the world-space target [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) the solver aims for before [`SmoothTime`](https://rapi.sleaze.dev/classes/IKControl.md) smoothing is applied.

Returns: The final target [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md), in world space, before smoothing.

### GetSmoothedFinalTarget

```luau
IKControl:GetSmoothedFinalTarget(): CFrame
```

- Tags: Capabilities: Animation

Returns the world-space target [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) the solver aims for after [`SmoothTime`](https://rapi.sleaze.dev/classes/IKControl.md) smoothing is applied.

Returns: The final target [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md), in world space, after smoothing.

### Solve

```luau
IKControl:Solve()
```

- Tags: Roblox script security, Capabilities: Animation

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
