Log in to vote

How would I go about fixing Handles movement?

Asked by 4 days ago

Hi, I think most acknowledged scripters of this place know about "Handles" instance, right? I've been testing some stuff with it to make movable part in-game (Just like Studio's part movement). And it works, pretty much. I used if face == Enum.NormalId.Back/Front/Etc then method and I thought that it was waaay to long so I decided to shorten it in 4-5 lines instead of using 6 elseifs. I found out how I possibly could do it and it worked but not as it should.

local H ="Handles")

function Snap(Pos)
    return / Grid + 0.5) * Grid),(math.floor(Pos.Y / Grid + 0.5) * Grid),(math.floor(Pos.Z / Grid + 0.5) * Grid))

    local Vect = Vector3.FromNormalId(face) *,dist,dist)
    local NewPos = Vect

    --if face == Enum.NormalId.Front then
    --  NewPos =,0,dist)

    t.Position = Snap(t.Position + NewPos)

The problem of this script is, it moves the part. But each time you move mouse further, it moves part faster and faster. My theory is it for some reason multiplies distance by distance when it just should multiply it by the face. I have no other theory and I have no idea how I could fix it so I'm asking people over there.

It's known that Snap function doesn't causes this problem so don't dig in it for your own sanity, the problem is Vect variable.

Answer this question