How do I tweenservice my hand to tool position with CFrames?

I want to tween players arm to the tool the player is currently looking at, but I can’t get it to work

uis.InputBegan:Connect(function(input, busy)
	if busy then return end
	if input.KeyCode == Enum.KeyCode.E then 
		local hand = char:FindFirstChild("Right Arm")
		local tool = MouseRaycast().Instance
		local handtween = tweenservice:Create(hand, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0, {CFrame.new(tool.CFrame)}))
		if tool and tool.Parent:IsA("Tool") then
			handtween:Play()
			event:FireServer(tool.Instance.Parent)
		end
	end
end)

I want something like this:

the error is following:

  01:08:27.053  Workspace.mlgfoxydan.pickUpTool:55: invalid argument #1 to 'new' (Vector3 expected, got CFrame)  -  Client - pickUpTool:55
  01:08:27.053  Stack Begin  -  Studio
  01:08:27.053  Script 'Workspace.mlgfoxydan.pickUpTool', Line 55  -  Studio - pickUpTool:55
  01:08:27.054  Stack End  -  Studio
1 Like

try using .Position instead of CFrame i think

2 Likes

No no no… the issue is that the goals {CFrame} is being put inside of the TweenInfo (which is the 2nd parameter) instead of the 3rd parameter. Also it just puts the CFrame in the goals instead of saying I want the CFrame to be this CFrame.

Before:

local handtween = tweenservice:Create(hand, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0, {CFrame.new(tool.CFrame)}))

After:

local handtween = tweenservice:Create(hand, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0), {CFrame = tool.CFrame})

P.S. I only found this topic because it was supposedly last active 2hrs ago