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 11 years ago

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

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

Please help!

1 answer

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

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

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

Answer this question