as you can see in this video, the part is never anchored. i made it so you can click and drag the part and it aligns with the walls.
https://gyazo.com/46ac70dc0a29be57ca1b5c32ba1dc852
however, it’s meant to drop as seen here. after the game has run for about 10-15 seconds, this is what happens:
https://gyazo.com/2983d9558ea9c2ee64afa0842898b26e
here’s the relevant code for dragging the part, has anyone experienced this issue before? thanks!
local function align()
if mouse.Target then
if mouse.TargetSurface.Name == "Top" then
target.Position = mouse.Hit.Position + Vector3.new(0,(target.Size.Y/2)+0.01,0)
elseif mouse.TargetSurface.Name == "Bottom" then
target.Position = mouse.Hit.Position - Vector3.new(0,(target.Size.Y/2)+0.01,0)
elseif mouse.TargetSurface.Name == "Front" then
target.Position = mouse.Hit.Position - Vector3.new(0,0,(target.Size.Z/2)+0.01)
elseif mouse.TargetSurface.Name == "Back" then
target.Position = mouse.Hit.Position + Vector3.new(0,0,(target.Size.Z/2)+0.01)
elseif mouse.TargetSurface.Name == "Right" then
target.Position = mouse.Hit.Position - Vector3.new((target.Size.X/2)+0.01,0,0)
elseif mouse.TargetSurface.Name == "Left" then
target.Position = mouse.Hit.Position + Vector3.new((target.Size.X/2)+0.01,0,0)
end
target.Orientation = mouse.Target.Orientation
end
end
mouse.Move:Connect(function()
if down == true and target ~= nil then
align()
end
end)