I’m trying to make a part “resize” towards my mouse. I’ve come pretty close, but I can’t get the last things right.
The part doesn’t go all the way to my mouse and it’s resizing in both directions when I want it to only go towards the mouse. It also doesn’t seem to work when I move the mouse to positive Vector3s? It won’t resize in the right direction if my mouse is at the bottom of the screen.
I have tried using the Resize() function to no avail-- it just seemingly endlessly resizes the part.
function update()
--start is the part's cframe (outside the function)
local pos = mouse.Hit.p
local distance = (start.p - pos).magnitude
if distance > 1000 then --limit distance otherwise it would get to 9999
distance = 1000
end
p.Size = Vector3.new(p.Size.X, p.Size.Y, distance)
p.CFrame = CFrame.new(Vector3.new(start.p.X, .5, start.p.Z), Vector3.new(pos.X, pos.Y, pos.Z)) * CFrame.new(0, 0, -distance / 2)
end
Also, I recommend changing the mouse TargetFilter to the part