Getting an error even it is right argument

Hi! I am making a NPC that walks to destination and facing to them, but error is occurring at facing.

local HumanoidRootPart = script.Parent.HumanoidRootPart
local Tween = TweenService:Create(HumanoidRootPart, TweenAnimation, {CFrame = CFrame.new(HumanoidRootPart, NearestPart.Position)})
Tween:Play()

As you can see, first argument is object, and TweenService:Create()'s first argument is instance(object).
so, I think It is right. but error occurred:


15:09:06.969 - Workspace.NPC.NPC:40: bad argument #1 (Vector3 expected, got Object)
15:09:06.969 - Stack Begin
15:09:06.969 - Script ‘Workspace.NPC.NPC’, Line 40
15:09:06.969 - Stack End


What am I wrong? or do you have a better opinion to letting NPC facing to the part?
*also variable “TweenService” and “TweenAnimation” is decleared correctly.

This isn’t quite right. You meant to do HumanoidRootPart.Position

HumanoidRootPartHumanoidRootPart.Position

Read what the error says.

Oh yeah, thank you. but I thought this error was made by TweenService:Create()'s argument error.
so I’m thinking It’s hard to debug it.

That’s fair tbh. The errors outputted by Roblox used to be more descriptive. A few years (months?) ago the error would be bad argument #1 to 'new' (Vector3 expected, got Object).