IKServiceClient
This item only works when running on the client. Client
Handles IK for local client.
tip
Be sure to also initialize the client side service IKService on the server to keep IK work.
Functions
Init
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
(
) →
(
)
Starts the service. Should be called via the ServiceBag.
GetRig
Retrieves an IKRig. Binds the rig if it isn't already bound.
PromiseRig
Retrieves an IKRig. Binds the rig if it isn't already bound.
SetAimPosition
IKServiceClient:
SetAimPosition
(
optionalPriority:
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.new(0, 0, 0), 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
Retrieves the local aimer for the local player.
GetLocalPlayerRig
Attempts to retrieve the local player's ik rig, if it exists.