Advertisement
StefanBashkir

Pseudo-joint

Feb 15th, 2014
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. local p1 = Workspace.Part1
  2. local p2 = Workspace.Part2
  3.  
  4. function WeldAnchoredParts(part1, part2)
  5.     coroutine.wrap(function()
  6.         local s = Game:GetService("RunService")
  7.         local originalspace = part2.CFrame:toObjectSpace(part1.CFrame)
  8.         s.RenderStepped:connect(function()
  9.             part1.CFrame = part2.CFrame:toWorldSpace(originalspace);
  10.         end)
  11.     end)()
  12. end
  13.  
  14. WeldAnchoredParts(p1,p2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement