Skip to main content

IKServiceClient

This item only works when running on the client. Client

Handles IK for local client.

TIP

Be sure to also initialize the server side service IKService.

Functions​

Init​

IKServiceClient.Init(
serviceBag: ServiceBag
) → ()

Initializes the service. Should be called via the ServiceBag.

local serviceBag = require("ServiceBag").new()
serviceBag:GetService(require("IKServiceClient"))

serviceBag:Init()
serviceBag:Start()

-- Configure
serviceBag:GetService(require("IKServiceClient")):SetLookAround(true)

Start​

IKServiceClient.Start(self: IKServiceClient) → ()

Starts the service. Should be called via the ServiceBag.

GetRig​

IKServiceClient.GetRig(
humanoid: Humanoid
) → IKRigClient?

Retrieves an IKRig. Binds the rig if it isn't already bound.

PromiseRig​

IKServiceClient.PromiseRig(
humanoid: Humanoid
) → Promise<IKRigClient>

Retrieves an IKRig. Binds the rig if it isn't already bound.

SetAimPosition​

IKServiceClient.SetAimPosition(
position: Vector3?,--

May be nil to set no position

priority: number?
) → ()

Exposed API for guns and other things to start setting aim position which will override for a limited time.

-- Make the local character always look towards the origin

local IKServiceClient = require("IKServiceClient")
local IKAimPositionPriorites = require("IKAimPositionPriorites")

RunService.Stepped:Connect(function()
	serviceBag:GetService(IKServiceClient):SetAimPosition(Vector3.zero, IKAimPositionPriorites.HIGH)
end)

SetLookAround​

IKServiceClient.SetLookAround(
lookAround: boolean
) → ()

If true, tells the local player to look around at whatever the camera is pointed at.

serviceBag:GetService(require("IKServiceClient")):SetLookAround(false)

GetLocalAimer​

IKServiceClient.GetLocalAimer(self: IKServiceClient) → IKRigAimerLocalPlayer

Retrieves the local aimer for the local player.

GetLocalPlayerRig​

IKServiceClient.GetLocalPlayerRig(self: IKServiceClient) → IKRigClient?

Attempts to retrieve the local player's ik rig, if it exists.

Show raw api
{
    "functions": [
        {
            "name": "Init",
            "desc": "Initializes the service. Should be called via the [ServiceBag].\n\n```lua\nlocal serviceBag = require(\"ServiceBag\").new()\nserviceBag:GetService(require(\"IKServiceClient\"))\n\nserviceBag:Init()\nserviceBag:Start()\n\n-- Configure\nserviceBag:GetService(require(\"IKServiceClient\")):SetLookAround(true)\n```",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "IKServiceClient"
                },
                {
                    "name": "serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 56,
                "path": "src/ik/src/Client/IKServiceClient.lua"
            }
        },
        {
            "name": "Start",
            "desc": "Starts the service. Should be called via the [ServiceBag].",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "IKServiceClient"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 81,
                "path": "src/ik/src/Client/IKServiceClient.lua"
            }
        },
        {
            "name": "GetRig",
            "desc": "Retrieves an IKRig. Binds the rig if it isn't already bound.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "IKServiceClient"
                },
                {
                    "name": "humanoid",
                    "desc": "",
                    "lua_type": "Humanoid"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "IKRigClient?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 94,
                "path": "src/ik/src/Client/IKServiceClient.lua"
            }
        },
        {
            "name": "PromiseRig",
            "desc": "Retrieves an IKRig. Binds the rig if it isn't already bound.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "IKServiceClient"
                },
                {
                    "name": "humanoid",
                    "desc": "",
                    "lua_type": "Humanoid"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<IKRigClient>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 106,
                "path": "src/ik/src/Client/IKServiceClient.lua"
            }
        },
        {
            "name": "SetAimPosition",
            "desc": "Exposed API for guns and other things to start setting aim position\nwhich will override for a limited time.\n\n```lua\n-- Make the local character always look towards the origin\n\nlocal IKServiceClient = require(\"IKServiceClient\")\nlocal IKAimPositionPriorites = require(\"IKAimPositionPriorites\")\n\nRunService.Stepped:Connect(function()\n\tserviceBag:GetService(IKServiceClient):SetAimPosition(Vector3.zero, IKAimPositionPriorites.HIGH)\nend)\n```",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "IKServiceClient"
                },
                {
                    "name": "position",
                    "desc": "May be nil to set no position",
                    "lua_type": "Vector3?"
                },
                {
                    "name": "priority",
                    "desc": "",
                    "lua_type": "number?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 131,
                "path": "src/ik/src/Client/IKServiceClient.lua"
            }
        },
        {
            "name": "SetLookAround",
            "desc": "If true, tells the local player to look around at whatever\nthe camera is pointed at.\n\n```lua\nserviceBag:GetService(require(\"IKServiceClient\")):SetLookAround(false)\n```",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "IKServiceClient"
                },
                {
                    "name": "lookAround",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 157,
                "path": "src/ik/src/Client/IKServiceClient.lua"
            }
        },
        {
            "name": "GetLocalAimer",
            "desc": "Retrieves the local aimer for the local player.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "IKServiceClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "IKRigAimerLocalPlayer"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 168,
                "path": "src/ik/src/Client/IKServiceClient.lua"
            }
        },
        {
            "name": "GetLocalPlayerRig",
            "desc": "Attempts to retrieve the local player's ik rig, if it exists.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "IKServiceClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "IKRigClient?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 184,
                "path": "src/ik/src/Client/IKServiceClient.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "IKServiceClient",
    "desc": "Handles IK for local client.\n\n:::tip\nBe sure to also initialize the server side service [IKService].\n:::",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 12,
        "path": "src/ik/src/Client/IKServiceClient.lua"
    }
}