Model not moving to correct location

I’m trying to clone a model to a spawn point but everytime I go to test this script it just teleports the model to the same location which is no where near the Position I directed it to.

local events = game.ReplicatedStorage.RemoteEvents

events.CloneBlimp.OnServerEvent:connect(function(player, blimp, parent)
	blimp:Clone().Parent = game.Workspace
	if player.TeamColor.Name == "Bright red" then
		blimp.Blimp:MoveTo(Vector3.new(game.Workspace.Everything.BlimpSpawns.Red.BlimpPos.Position))
		print("moved to location")
		local char = game.Workspace:FindFirstChild(player.Name)
		char.Torso.CFrame = CFrame.new(Vector3.new(blimp.Blimp.DriverSeat.Position), 10, math.random(1, 1))
	end
end)
2 Likes

Store the cloned blimp in a variable, THEN parent it and move the clone around. RIght now you’re moving the original blimp (the one you’re cloning from) instead of the new copy.

events.CloneBlimp.OnServerEvent:connect(function(player, blimp, parent)
	local blimpClone = blimp:Clone()
	blimpClone.Parent = game.Workspace
	if player.TeamColor.Name == “Bright red” then
		blimpClone.Blimp:MoveTo(Vector3.new(game.Workspace.Everything.BlimpSpawns.Red.BlimpPos.Position))
		print(“moved to location”)
		local char = game.Workspace:FindFirstChild(player.Name)
		char.Torso.CFrame = CFrame.new(Vector3.new(blimpClone.Blimp.DriverSeat.Position), 10, math.random(1, 1))
	end
end)

Not related to the question, but just general advice: you should surround your scripts in ``` (three backticks) so that it’s properly formatted and easier to read.

I did that but the model fell apart and didn’t move to the correct location.

Are the parts inside the model welded together?

They use the weld surface.

Try copying the blimp and pasting it into the workspace then click play here so that you spawn by it. If it falls apart then the weld surface isn’t working.

It doesn’t fall apart without being cloned. Maybe anchoring the parts until it is cloned into the right location then un-anchoring them will work?

Nope.

FIxed it, I had to use a weld script.

1 Like

Instead of using a Weld script, you can call model:MakeJoints() after parenting it to Workspace.

Thanks, but do you know why my model is not moving to the intended position? It just spawns at what I think is position (0, 0, 0) and not the position of the BlimpPos part.

EDIT: I just checked and it is spawning at 0,0,0

Here is the updated script ‘’'local events = game.ReplicatedStorage.RemoteEvents

events.CloneBlimp.OnServerEvent:connect(function(player, blimp, parent)
local clone = blimp:Clone()

clone.Parent = game.Workspace
if player.TeamColor.Name == "Bright red" then
clone.Blimp:MoveTo(Vector3.new(game.Workspace.BlimpPos.Position))
local char = game.Workspace:FindFirstChild(player.Name)
char.Torso.CFrame = CFrame.new(Vector3.new(clone.person299.Position), 10, (math.random(1,1)))
clone.Name = player.Name.."Blimp"

else
	clone.Blimp:MoveTo(Vector3.new(game.Workspace.BlimpPos.Position))
local char = game.Workspace:FindFirstChild(player.Name)
char.Torso.CFrame = CFrame.new(Vector3.new(clone.person299.Position), 10, (math.random(1,1)))
clone.Name = player.Name.."Blimp"
	
end

end)

1 Like

Calling clone:MoveTo rather than clone.Blimp:MoveTo should work.

Still moves to 0,0,0

Why are you creating a new Vector3 using the blimp’s current position? It’s position is already a Vector3. I think constructing a Vector3 out of a Vector3 creates an error because it’s already a Vector3, right?

So, how do I move it without creating a vector3?

Just use workspace.BlimpPos.Position, because .Position is already a Vector3, as stated here.