A client made object affecting server parts

I am making a placement system with a client made sentry, where it is supposed to collide, but not move with non-player parts in the workspace. However, the sentry i spawned seems to be able to move a tree in the client and replicate the movement into the server which is not what I want.

Video showing the problem in detail: https://youtu.be/HIRyKuVUAyQ

This is strange as I clone the sentry in the client, and it moves server stuff

This is the collision group setting for the sentry, and I made it so that the sentry can collide with regular workspace parts, but not other players or sentries
image

Below is the script I use to replicate the sentry:

local function AddPlaceholderSentry(attack)
	RemovePlaceholderSentry()
	
	sentryToSpawn = attack.Sentry.Value:Clone()
	sentryToSpawn.Parent = workspace
	
	for i, object in ipairs(sentryToSpawn:GetDescendants()) do
		if object:IsA("BasePart") then
			PhysicsService:SetPartCollisionGroup(object, "SentryToSpawn")
			object.Material = Enum.Material.ForceField
		end
	end
end

RunService.RenderStepped:Connect(function()
	if not sentryToSpawn then
		return
	end
	
	local result = MouseRaycast(sentryToSpawn)
	local x = result.Position.X
	local y = result.Position.Y + (sentryToSpawn:GetExtentsSize().Y / 2)
	local z = result.Position.Z
	
	local cframe = CFrame.new(x, y, z) * CFrame.Angles(0, math.rad(rotation), 0)
	sentryToSpawn:SetPrimaryPartCFrame(cframe)
end)

Post down in the comments if you could help!

Anchor your trees.


Best regards,
Pinker

other than the trees, moving unanchorable parts would cause an unfair advantage to happen to the player and there may be stuff I don’t want to anchor

Oh yeah it can also push unanchored humanoids as well which is a problem of the sentry, not the trees

think of the unplaced sentry as a ghost that collides with its surrounding objects but cannot move it
is the alternative complicated?

Just make it so the clone cant collide? Or give it a collision group with the ground only.

1 Like

I also want the sentry to collide with the anchored parts on the map that I may add like buildings and trees, but not be able to move them

essentially, unanchored parts are ‘anchored’ on collision with the sentry
is that too much to ask for?

Yk youtube exists… try searching roblox studio placement system

1 Like

Or just make it so the parts aren’t unanchored, where they only unanchor in the situation you want them to. Also implement collison groups so it cant touch npcs.

1 Like

hmm ill try and figure out something