local function onTouchedBall(hit) print(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(script.Parent.VehicleSeat.CFrame.Position)) end end script.Parent.Touched:Connect(onTouchedBall)
I don't understand why it teleports me to the center of the map instead of the position I specified.
You made it too complicated as Block_manvn said just do:
local function onTouchedBall(hit) print(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.HumanoidRootPart.CFrame = script.Parent.VechicleSeat.CFrame end end script.Parent.Touched:Connect(onTouchedBall)
Read this to understand more about CFrames: https://developer.roblox.com/en-us/api-reference/datatype/CFrame