Non-Physics Alternative to Welds

Welds are currently a very common method for moving groups of objects dynamically, especially for guns in First Person Shooters that follow the camera. But these do extra physics calculations, and do not work when attached to anchored parts. Not to mention can constantly render a part wrong and put it in places it shouldn’t be when things like SurfaceGUI’s and even selectionboxes display where the part is supposed to be correctly. The alternative would be CFraming the gun but this is a pain to do, can be laggy, and has to be updated every frame when connected to something moving.

It can be made lag-free.

Animation Lab uses anchored parts that are CFramed

I’ll set up an object like this:

local Class = {}

function Class.new()
   local this = {}

   function this.Render(cframe)
      --part.CFrame = cframe * offset -- or something
   end

   return this
end

return Class

I always though CFraming moderate groups of parts was laggy when done at 60 FPS.

Motor6D. It’s like a weld but works when one of the parts is anchored.

What about the inaccurate brick display issues?

inaccuracies are dependent on your weld function and proximity to the origin.

The inaccuracies are purely ROBLOX’s end, even when they are less than a stud away from your face and welded to a part 1 stud below it. ROBLOX knows where the part is supposed to be and even displays surfaceguis there, but the part is displayed somewhere else

  1. CFrames in welds are sometimes stored as floats and not doubles. Bad idea if your weld algorithm just stores two inverses instead of the actual difference in CFrame. It makes a big difference when you get away from the origin.

  2. I want to see this inaccurate SurfaceGui placement. Remember, SurfaceGuis get further and further away from the part when the part gets further away from the origin (to a degree that is extreme, it could probably be turned down quite a bit).

  1. I do actually use the difference, no inverses.
  2. The surfaceguis are displayed as if the part were properly placed. In other words, the surfacegui’s are floating exactly where you’d expect. The parts however are not in the right place. I’ll get a picture when roblox gets the site back up.

I haven’t had much trouble with welds, though I do think they should work with anchored parts.