i want the player's right arm to point to where the player's mouse is. i think the best solution is to use the "right shoulder" motor6d but with my current system it looks super messed up and i can't figure this out
forgive the bad formatting, the script is in the prototype phase
--local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local tool = script.Parent
local equip_connection: RBXScriptConnection
local animation = tool:WaitForChild("freeze_right_arm")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid: Humanoid = character:WaitForChild("Humanoid")
local animator: Animator = humanoid:WaitForChild("Animator")
local animation_track = animator:LoadAnimation(animation)
local torso: Part = character:WaitForChild("Torso")
local right_arm: Part = character:WaitForChild("Right Arm")
local right_shoulder_m6d: Motor6D = torso:WaitForChild("Right Shoulder")
local mouse: Mouse = player:GetMouse()
local right_shoulder_initial_c0 = right_shoulder_m6d.C0
animation_track.Priority = Enum.AnimationPriority.Action
local function point_arm()
local mouse_pos = mouse.Hit.Position
local right_arm_pos = right_arm.Position
local point_to_pos = CFrame.lookAt(right_arm_pos, mouse_pos)
local x, y, z = point_to_pos:ToOrientation()
right_shoulder_m6d.C0 = right_shoulder_initial_c0 * CFrame.Angles(x, y, z)
end
tool.Equipped:Connect(function()
animation_track:Play()
equip_connection = RunService.RenderStepped:Connect(point_arm)
end)
tool.Unequipped:Connect(function()
animation_track:Stop()
if (equip_connection) then
equip_connection:Disconnect()
equip_connection = nil
right_shoulder_m6d.C0 = right_shoulder_initial_c0
end
end)
** You are now Level 1! **