:Moveto is placing model in wrong place

I want to move a model to another place using :Moveto. But its moving it to the wrong place. I’m new to scripting so i apologise if this is a simple mistake. I want it to move to the position of a part that was in a local script. When i print the wanted position, it says the right position. But when i put that into the :Moveto as a variable, it dosen’t move there.

Here is my code

game.ReplicatedStorage.Remotes.Build.OnServerEvent:Connect(function(plr,pos,block)
	local Grass = game.ReplicatedStorage.Blocks.Grass:Clone()
	Grass.Parent = workspace.Studs
	print(pos)
	local Position = Vector3.new(pos)
	Grass.PrimaryPart = Grass.Grass
	Grass:MoveTo(Position)
	plr.Blocks.Grass.Value = plr.Blocks.Grass.Value - 1
end)

I don’t understand what i’m doing wrong here so any help is great.

i think :MoveTo() is a function that only works for humanoids

just try tweening, its amazing and very customizable, as well as smooth

I switched it to a tween and it works if i try move it to any other vector 3, but as soon as i try put the Pos variable in it, the block won’t move.

Can you try printing the Position variable after defining it? I’m pretty sure the way you are defining the variable is incorrect

I just fixed it. I was using block.position = Vector3.new(pos) but when i switched it to Block to position = pos It worked

Thanks for your help

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.