Hello, this problem happened me for over 1 month and still cant get a solution, asked for help even in RSC Discord and now im here…
Im trying to implement ikcontrols into my steering wheel but it seems to dont work properly.
yes, I know this code can be greatly optimized but im trying to rush
local rv = game.Workspace:WaitForChild("RV")
local hull = rv:WaitForChild("hull")
local testseat = hull:WaitForChild("steeringwheel"):WaitForChild("Part")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local RenderStepped = game:GetService("RunService").RenderStepped
local ViewModel = game:GetService("ReplicatedStorage").ViewModel:Clone()
local freemode = game.ReplicatedStorage.freemode
local ViewModelRoot = ViewModel.PrimaryPart
ViewModel.Parent = workspace
local seated = false
RenderStepped:Connect(function ()
if seated then
ViewModelRoot.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, -1.5, 0)
else
ViewModelRoot.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0, -1.5, 0)
end
-- Hardcoded logic test
ViewModel.LeftUpperArm.LeftShoulder.Transform = char.LeftUpperArm.LeftShoulder.Transform
ViewModel.RightUpperArm.RightShoulder.Transform = char.RightUpperArm.RightShoulder.Transform
end)
local ikcontrol = Instance.new("IKControl")
ikcontrol.Enabled = false
ikcontrol.Type = Enum.IKControlType.Transform
ikcontrol.EndEffector = char.LeftHand
ikcontrol.Target = testseat.lefthand
ikcontrol.ChainRoot = char.LeftUpperArm
ikcontrol.Parent = char.Humanoid
local ikcontrol2 = Instance.new("IKControl")
ikcontrol2.Enabled = false
ikcontrol2.Type = Enum.IKControlType.Transform
ikcontrol2.EndEffector = char.RightHand
ikcontrol2.Target = testseat.righthand
ikcontrol2.ChainRoot = char.RightUpperArm
ikcontrol2.Parent = char.Humanoid
char.Humanoid.Seated:Connect(function(active,seat)
if active == false then
ikcontrol.Enabled = false
ikcontrol2.Enabled = false
else
seated = true
ikcontrol.Enabled = true
ikcontrol2.Enabled = true
end
end)
freemode.OnClientEvent:Connect(function(state)
if state == true then
ikcontrol.Enabled = false
ikcontrol2.Enabled = false
else
ikcontrol.Enabled = true
ikcontrol2.Enabled = true
end
end)
Result?:
What you tried so far?
Use a part instead of a mesh
Change endeffectorOffset and others
Would really appreciate any help