I’m trying to create something like what the sims has with floor placement.
So basically, a floor part is made, and it follows the mouse, when the player click, the floor part stays where it is, and is extended in either direction depending which way the player drags their mouse.
So the part is being centered on the grid, instead of being inside each grid box (which is 5 stud squares, same size as the floor part)
And then from here I’m not sure what to do. I don’t know to increase it’s size like how I want it. Problem with just going part.Size is it would increase in size from the centre, instead of the edge
Video example
Couldn’t you get the starting vector and the ending vector, get the distance from the two (that’d be the size of the floor) as well as the center of the two and size it accordingly? I could be wrong here.
So this is where I’m at. So when they click it stops the moving tile, gets that tiles vector. How can I get the ‘new vector’ tho? As mouse.Hit.p is a CFrame value
I’m not entirely sure what is causing this, I’ll try and script something up myself to see if I can replicate this and or find a solution. I can’t promise it’ll be done tonight though.
Hey, I was trying to do something like this. Not sure if you ever figured it out. I came across this question because I was also looking to see how to do it.
RunService:BindToRenderStep("DrawPart", Enum.RenderPriority.Input.Value, function(Step)
local Hit = Mouse.Hit
local Distance = 0
if LastHit then Distance = (LastHit.Position - Hit.Position).Magnitude end
local Center = (LastHit.Position + Hit.Position) / 2
local DistX = LastHit.Position.X - Hit.Position.X
local DistZ = LastHit.Position.Z - Hit.Position.Z
Workspace.BoxSelect.CFrame = CFrame.new(Center)
Workspace.BoxSelect.Size = Vector3.new( math.abs(DistX), 2,math.abs(DistZ) )
end)
From reading the thread
I indeed positioned a part to the center, and then set the size based on the distance from the initial click and the current mouse position.