Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

2 comments

0

Awesome, thanks so much!

0

No problem!

This discussion is preserved as it was. New answers, comments, and votes are closed.