What do you want to achieve? Keep it simple and clear!
as i mentioned in the title, i’d like to make my hands move toward the mouse, overriding an animation
What is the issue? Include screenshots / videos if possible!
i don’t know how to do it
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i did, and the best i could do was find a script that made my hands to follow the mouse didn’t override my animation
And btw, this is my code: "local UpperRightArm = script.Parent.UpperRightArm
local UpperLeftArm = script.Parent.UpperLeftArm
while true do
UpperRightArm.CFrame = CFrame.lookAt(game.Workspace.CurrentCamera.CFrame.p)
UpperLeftArm.CFrame = CFrame.lookAt(game.Workspace.CurrentCamera.CFrame.p)
end"
while true do
UpperRightArm.CFrame = CFrame.lookAt(game.Workspace.CurrentCamera.CFrame.p)
UpperLeftArm.CFrame = CFrame.lookAt(game.Workspace.CurrentCamera.CFrame.p)
end
This code will definitely crash your game, so don’t use this. You would need a while task.wait() do loop, .RenderStepped, or Mouse.Move to prevent the crash. Also, you’re using CFrames wrong:
CFrame.lookAt(pos, lookAtPos)
There are two arguments instead of one. I don’t think you can set limb cframes because they are welded with Motor6D’s to be animatable. Try setting those instead.
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local UpperRightArm = character:WaitForChild("RightUpperArm")
local UpperLeftArm = character:WaitForChild("LeftUpperArm")
local mouse = player:GetMouse()
mouse.Move:Connect(function()
UpperRightArm.CFrame = CFrame.lookAt(UpperRightArm.Position, game.Workspace.CurrentCamera.CFrame.p)
UpperLeftArm.CFrame = CFrame.lookAt(UpperLeftArm.Position, game.Workspace.CurrentCamera.CFrame.p) -- i've tried mouse.Hit.p in the second clip, but the outcome was similar
end)