PLEASE READ EDIT BELOW!
Having done those 2 things, it doesnt do the weird glitch, but the wall now is like titled? and it rotates around as your move the mouse around. Wall should be straight up vertical, and it’s being cloned from a model that is vertical
EDIT
Managed to find a fix for it, using some reference from other placement systems:
function RoundVector(vector, unit)
return vector - Vector3.new(vector.X%unit, 0, vector.Z%unit)
end
function wall:StartPlacing(playersPlot, mouse)
local wallClone = wallModel:Clone()
wallClone.Parent = playersPlot.Camera
runService.RenderStepped:Connect(function()
wallClone:SetPrimaryPartCFrame(CFrame.new(RoundVector(mouse.Hit.p,1)+Vector3.new(0,(wallClone.PrimaryPart.Size.Y/2),0)))
end)
end
More problems then arise though (constant problems )
- can be moved anywhere in the game (I’m not 100% sure how to go about locking it to the baseplate grid)
- if you move your mouse up the side walls, the wall goes up with it. Is there anyway to make it so the parts bottom basically is ‘stuck’ in a sense to the floor.
Example of the wall moving up the wall
Few ‘solutions’ that I think would have something to do with the above problems:
- Getting the floors size / 2 to lock to part to only be placed within the baseplate.
- Doing something like wallClone.PrrimaryPart.Size.Y / 2 could get the bottom of the PrimaryPart, and thus set it somehow so it’s Y value can’t go any higher (or lower) and thus keep it on the ground at all times
Any advice or help is greatly appreciated
Also, another problem I have seen
The baseplate for placement has the position and size at round numbers, and the below image shows the hitbox locking to the same round numbers (so no decimals) but the hitbox ain’t in line with the studs, even tho they both have no decimals in their positions.
Is there a way to get it to be placing based on the base plate and not the Roblox world?? Because if I move the baseplate to a random position with decimals, it’d mess with the system, but if the parts lock to the grid of the base (which the size of it will always be round even numbers) then I wouldn’t have to stress about keeping the base to always be in a certain position to work