Rock move issues

So this is sorta a dupe post but I am gonna explain this better.
When you click on the rock, it will tp the rock to anywhere on the baseplate. I decided to make some decor on the rock but for some reason it only tp’s the rock, not the decor.

This is the script:

rocks = workspace.Rocks:GetChildren()
touching = false
touchingparts = {}

for i=1, #rocks, 1 do
	rocks[i].Primary.ClickDetector.MouseClick:Connect(function()
		repeat
			touching = false
			rocks[i].Primary.CFrame = CFrame.new(workspace.RockSpawnArea.Position.X + math.random(-workspace.RockSpawnArea.Size.X/2, workspace.RockSpawnArea.Size.X/2), rocks[i].Primary.Position.Y, workspace.RockSpawnArea.Position.X + math.random(-workspace.RockSpawnArea.Size.X/2, workspace.RockSpawnArea.Size.X/2))
			touchingparts = rocks[i].Primary:GetTouchingParts()
			for c=1, #touchingparts, 1 do
				if touchingparts[c].Name == "terrain" then
					touching = true
					break
				end
			end
		until touching == false
	end)
end

an image to help:
Screen Shot 2020-08-23 at 4.50.24 pm
As you can see, it tp’ed the rock and just left the ores behind.
Some info: They are all in a model.

2 Likes

Technically, all that is going on is: When you click the rock, it is supposed to teleport the whole model (5 parts) but only teleports the primary part.

image

Thats not on my pc… Idk why

Oh, its because my game was a place, not a game.

Nevermind, still not working. Why do you need it though? I have explained the issue.

If you want help then upload the file, enough with the questions.

I cannot upload the file. It is not working.

That makes no sense at all to just say tough

This is what happens: Screen Shot 2020-08-23 at 6.52.36 pm

Leave the script and then click on Download a copy…

Try welding the decor to the rock.

1 Like

Since you wont send the studio file I just made what I think it is that you want

MoveRocks.rbxl (60.3 KB)

MoveRockz.rbxl (60.4 KB)

You should union the decors to the rock if you want to move all of them. So it acts as one part.

They move together just fine?


If you union the decors to the rock, they act like it’s only one part. So when you click the rock you should be able to move it with all the decors.

Why would I do this when they are already moving correctly

Doesn’t the rock move without the decors?

No? what are you on about


The author of this help request says that the rock moves without the ore decorations on it.