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

How do I force the position of a part even when there is a part already there?

Asked by 10 years ago

I can't find out how CFraming works... the best I can do is

function onTouch(hit)
if hit.Parent:findFirstChild("Humanoid") then
for I=1,50 do
script.Parent.Position=script.Parent.Position+Vector3.new(0,0.5,0)
--but if there's a part in the way, it teleports to the top of that part.
end
end
end

Please help!

1 answer

Log in to vote
2
Answered by
war8989 35
10 years ago

Use CFrame to position the part while ignoring the collisions of other parts.

function onTouch(hit)
    if hit.Parent:findFirstChild("Humanoid") then
        for I = 1, 50 do
            script.Parent.CFrame = CFrame.new(0, 0.5, 0)
        end
    end
end
0
Awesome, thanks so much! ChipioIndustries 454 — 10y
0
No problem! war8989 35 — 10y
Ad

Answer this question