True, but the real reason why RenderStepped has a dedicated sync function is because it’s meant for updating Positions of objects. I highly doubt he’d be using other functions binded to the same event that will manipulate the same piece of furniture, so there is no particular reason to sync it with anything.
You only need to sync them if firing one function before the other will cause bugs.
Yeah I saw the reasoning for ray casting to prevent things from being placed outside I was thinking that you guys were going to use ray casting as well to detect if it’s touching a wall. My bad,
local lasthit = nil
RenderStepped = RunService.RenderStepped:Connect(function()
local ignl = {player.Character,PlayersPlot.Base, ItemClone, PlayersPlot.House}
local p0,p1 = player.Character.Head.Position, mouse.Hit.Position
local dir = p1-p0
dir = dir+dir.Unit*0.2
local ray = Ray.new(p0,dir)
local HitPart = workspace:FindPartOnRayWithIgnoreList(ray,ignl)
if not HitPart then
if workspace:FindPartInRegion3WithIgnoreList(ItemClone.PrimaryPart, ignl) then --ERROR
RenderPosition(PlayersPlot, mouse.Hit.p, ItemClone, LowerX, UpperX, LowerZ, UpperZ)
end
elseif HitPart~=lasthit then
lasthit = HitPart; print(HitPart.Name)
end
end)
Error
[FindPartInRegion3WithIgnoreList is not a valid member of Workspace]
BTW, the first argument has to be a Region3.
local positon, size = mouse.Position, hitbox.Size
local region = Region3.new(position-size/2,position+size/2)
workspace:FindPartsInRegion3WithIgnoreList(region,ignl)