Hello, i need help with Motor6D
I want to make nps's arm is looking at mouse with using Motor6D
Idk whats is wrong in my scripts
My scripts:
Mouse = game.Players.LocalPlayer:GetMouse()
Motor = workspace.Test1.Torso["Right Shoulder"]
Mouse.move:Connect(function()
Motor.C0 = CFrame.new(Motor.C0.Position, Mouse.Hit.p)
end)
Mouse = game.Players.LocalPlayer:GetMouse()
Motor = workspace.Test2.Torso["Right Shoulder"]
Mouse.move:Connect(function()
Motor.C0 = Motor.C0:Lerp(CFrame.Angles(Mouse.Hit.p.x, Mouse.Hit.p.y,Mouse.Hit.p.z), 1)
end)
Mouse = game.Players.LocalPlayer:GetMouse()
Motor = workspace.Test3.Torso["Right Shoulder"]
Mouse.move:Connect(function()
Motor.C0 = CFrame.Angles(Mouse.Hit.p.x, Mouse.Hit.p.y, Mouse.hit.p.z)
end)
Mouse = game.Players.LocalPlayer:GetMouse()
Motor = workspace.Test3.Torso["Right Shoulder"]
Mouse.move:Connect(function()
Motor.C0 = Motor.C1
Motor.C0 = CFrame.Angles(Mouse.Hit.p.x, Mouse.Hit.p.y, Mouse.hit.p.z)
end)
Questions? Give these as comment or just check that place https://web.roblox.com/games/2506261891/test (everyone can edit it) i've put there scripts that i need help with these

1 comment
Mouse.Hit gets the mouse's position, you could use this to change the arm's angle to point at the position of the mouse.