Model :MoveTo not working correctly

  1. What do you want to achieve?

I want to move the model to the player’s position using :MoveTo

  1. What is the issue? Include screenshots / videos if possible!

The issue that the model or car is spawning where it originally was placed before getting put into server storage

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have tried setting a primary part however it still stayed the same.

Script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SpawnCar = ReplicatedStorage:FindFirstChild("SpawnCar")

local Module = require(game.ReplicatedStorage.ModuleScript)

SpawnCar.OnServerEvent:Connect(function(player)
	local Car = game.ServerStorage.Cars["RCHAS BaconX3"]
	local CarClone = Car:Clone()
	local Character = Module.PlayerCharacter(player)
	local CharacterPosition = Character.HumanoidRootPart.Position
	
	CarClone:MoveTo(CharacterPosition + Vector3.new(0,5,0))
	CarClone.Parent = game.Workspace
end)
1 Like

Turns out you can not use :MoveTo() on a model. use
:SetPrimaryPartCFrame() if wanting to Teleport the car model to you.

1 Like

I might have this Character.HumanoidRootPart.CFrame})):play() wrong
because of brackets })) Hope you will be able to fix it, if not tell me

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SpawnCar = ReplicatedStorage:FindFirstChild("SpawnCar")

local TweenService = game:GetService("TweenService")

local Module = require(game.ReplicatedStorage.ModuleScript)

SpawnCar.OnServerEvent:Connect(function(player)
	local Car = game.ServerStorage.Cars["RCHAS BaconX3"]
	local CarClone = Car:Clone()
	local Character = Module.PlayerCharacter(player)
	local CharacterPosition = Character.HumanoidRootPart.Position
	
    CarClone.Parent = workspace
    TweenService:Create(CarClone.PrimaryPart, TweenInfo.new(2), {CFrame = Character.HumanoidRootPart.CFrame})):play()
	--CarClone:MoveTo(CharacterPosition + Vector3.new(0,5,0))
--	CarClone.Parent = game.Workspace
end)