Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is my placement system acting weird?

So im making a placement system right now and something weird is happening the code and a short vid are below

wait()
local plan = game.ReplicatedStorage.Floor.Selection
local build = game.ReplicatedStorage.Floor.floor
local pos = Vector3.new(0,0,0)
script.Parent.Equipped:Connect(function(mouse)
	local plan1 = plan:Clone()
	plan1.Parent = game.Workspace
	mouse.Button1Down:connect(function()
		print("ok")
		local build1 = build:Clone()
		build1.Parent = game.Workspace
		build1.Position = plan1.Position
	end)
	while wait() do
		pos = Vector3.new(math.floor(mouse.Hit.p.X),math.floor(mouse.Hit.p.Y),math.floor(mouse.Hit.p.Z))
		plan1.Position = pos+Vector3.new(0,0,0)
	end
end)

https://medal.tv/clips/33015914/d13373Haqm99 can anyone help me solve this issue?

1 comment

0

it looks like the Mouse.hit is hitting the thing your moving causing the "getting closer" bug. Might be worth offsetting the placement for the thing your moving with the mouse so the mouse.hit only hits the thing your trying to build and not the part your moving.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.