Is WeldConstaint improve performance on moving models?

Hello, I’m trying to make my line of sight system more performant, and currently I have some questions about the performance of the moving model

Is welding all part of the model to a basepart then moving it is more performant than just use :PivotTo() ?

Hey Kute,

Good question! Seeking the best performance to move models in Roblox, both welding parts to a basepart and using :PivotTo() have pros and cons. Let me explain how both work so that you know what to do:

WeldConstraints Pros:

  • Performance: Welding parts together improves performance since the model is welded as one piece, significantly reducing the number of physics calculations Roblox needs to execute.
  • Stability: Welds prevent parts from moving away from each other. This has the benefit of holding your model integrity.

Cons:

  • Time Setup: Much more time is spent creating and managing the WeldConstraints.
  • Stiffness: The welds limit parts relative motion; they cannot move without adjusting or breaking the welds.

:PivotTo()

Pros:

  • Ease: Coming to use:PivotTo() it’s quite simple and easy to implement since you only move the model to wanted position.
  • Flexibility: It allows more dynamics in adjustment since you can pivot the whole model in any position or orientation.

Cons:
This can have poor performance in the case of large models or when the position is updated frequently. The reason is that this recalculates the position for all parts within the model.

Recommendation

If you have a complex model with many parts, frequently moving them around, WeldConstraints could bring an improvement to your game’s performance by reducing Physics Calculations. This is because Roblox will treat the whole model as one object and not as parts.

However, in case you want simplicity and flexibility,;:PivotTo() wins. In case of really small models or you are going to move it less often, the difference in performance won’t matter that much, and;:PivotTo() renders everything pretty clean and easy to steer.

Put together, it would be:

  • WeldConstraints in case of better performance with a complex model
  • =:PivotTo() if you value simplicity and flexibility

Hope this helps; good luck with your LoS system!

1 Like

Thank you so much for the detailed replies. I will implement weldConstaint for LoS.

1 Like

My pleasure! If you require any more help- Just let me know by PMing me or replying (and mentioning me).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.