I'm making an unique crate unboxing system where crates will fall from the sky like an airdrop. I'm currently stuck at tweening the camera to focus at the key hole that's on the crate.
local tweenAnim = tweenService:Create(crateMain, tweenInfo, {Position = CFrame.new(Vector3.new(keyHole.Position.X + (keyHole.Size.X * 1.5), keyHole.Position.Y + (keyHole.CFrame.UpVector * 4), keyHole.Position.Z), Vector3.new(keyHole.Position.X, keyHole.Position.Y, keyHole.Position.Z))})
Here's the error.
20:52:38.751 - ReplicatedStorage.CrateSystem:312: bad argument #1 to '?' (Vector3 expected, got number) 20:52:38.752 - Stack Begin 20:52:38.752 - Script 'ReplicatedStorage.CrateSystem', Line 312 20:52:38.752 - Stack End
I'm pretty sure that only the CFrame part errors.
CFrame.new(Vector3.new(keyHole.Position.X + (keyHole.Size.X * 1.5), keyHole.Position.Y + (keyHole.CFrame.UpVector * 4), keyHole.Position.Z), Vector3.new(keyHole.Position.X, keyHole.Position.Y, keyHole.Position.Z))
Any idea on how to fix it? Thanks.

6 comments
It only has 2 arguments, the coordinated to tween to and the coordinate to point at
I double checked the blankets, nothing is wrong with them
Both of the arguments are Vector3 coordinates
keyHole.Position.Y + (keyHole.CFrame.UpVector * 4) is where the error is.
how am I suppose to read that ;-;
Remove the Vector3.new because the CFrame already checks for the position