Arm point to the mouse position like Rec Room

Hello developers,

I wanted to ask if you can help me to make a targeting system like the one in Rec Room, that is, you are in first person and by holding down a key you can move your hands freely, if you help me I would be very grateful

Example:

image

ahh yes i made this once it just points doe hold on lemme get the script…

1 Like

put it in startercharacter script

local Camera = workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local ToolEquipped = false

local Character = Player.Character or Player.CharacterAdded:Wait()
local Root = Character:WaitForChild("HumanoidRootPart")
local RightShoulder = Character:FindFirstChild("RightShoulder", true)
local Neck = Character:FindFirstChild("Neck", true)
local YOffset = RightShoulder.C0.Y
local YOffset3 =  Neck.C0.Y

local Tool = nil
Character.ChildAdded:Connect(function(Child)
	if Child:IsA("Tool") then
		ToolEquipped = true
		Tool = Child
	end
end)
Character.ChildRemoved:Connect(function(Child)
	if Child == Tool then
		Tool = nil
		ToolEquipped = false
	end
end)


game:GetService("RunService").RenderStepped:Connect(function()
	local CameraDirection = Root.CFrame:toObjectSpace(Mouse.Hit).lookVector
	if RightShoulder then
		local Offset = CFrame.Angles(math.rad(90), 0, 0)
		if ToolEquipped == true then
			Offset = CFrame.Angles(math.rad(0), 0, 0)
		else
			Offset = CFrame.Angles(math.rad(90), 0, 0)
		end
		Neck.C0 = CFrame.new(0, YOffset3, 0) * CFrame.Angles(0, -math.asin(CameraDirection.X), 0) * CFrame.Angles(math.asin(CameraDirection.Y), 0, 0)
		RightShoulder.C0 = CFrame.new(1, YOffset, 0) * CFrame.Angles(0, -math.asin(CameraDirection.X), 0) * CFrame.Angles(math.asin(CameraDirection.Y), 0, 0) * Offset
	end
end)
3 Likes

also tbh i know rec room has many good graphics and its a very nice and a game with many many features but we all know its a copy

do u have an R6 version?

im using R6

no sorry i dont just edit the script a bit

1 Like

Thank you anyway, I would only need the trigger for the key (E key from the keyboard)