Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to find the object being resized?

Asked by 9 years ago
function onHandlesDrag(normal, distance)
    .Anchored = true
    if handles.Adornee then
        local delta = distance - previousDistance 
        if math.abs(delta) >= handles.Adornee.ResizeIncrement then
            local sizeDelta = math.floor(delta / handles.Adornee.ResizeIncrement + 0.5) * handles.Adornee.ResizeIncrement
            if handles.Adornee:Resize(normal, sizeDelta) then
                previousDistance = distance
            end
        end
    end
end

As you can see i have put .Anchored = true because the first thing i want is the resized part to be Anchored but i dont know which part is being resized or how to find it...

Thanks for the help! :D

0
Assuming you clicked on the part before being able to resize it, just pass the argument through to the onHandlesDrag function Validark 1580 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

The part you're moving/resizing is handles.Adornee. So, after what is currently line 2, put handles.Adornee.Anchored = true

Ad

Answer this question