In this script I'm wanting this brick to move up when touched and while it does work, it teleports above my player instead of normally just going up. Basically, how would I get this to work with CFrame? The wiki didn't really help much, any help?
p = script.Parent script.Parent.Touched:connect(function() for i=0,100,0.1 do wait(.01) p.Position = p.Position + Vector3.new(0,1,0) end end)
Using Position
will put it above the object if is colliding with another block. Using CFrame
is basically the same here is what your script would look like with CFrame
:
p = script.Parent script.Parent.Touched:connect(function() for i=0,100,0.1 do wait(.01) p.CFrame= p.CFrame * CFrame.new(0,1,0) end end)