How can I make a efficient model tweening module that is smooth and uses the primary part of a model?
I think you can just check when the primary part of a model changes, and then move everything else relatively (by storing a vector3 earlier), or by just looping though a model’s child and tweening it to an end point all at the same time. ex:
-- example 1 (Primary part changes)
-- PESUDO CODE
Function to add a listener (Model)
Save offsets in a table, which labels the instance
Add event listener for position change
using the children, and their related offsets, update
-- example 2
-- PESUDO CODE
Function to fire tween (Model, tweenInfo, newPosition)
Save offsets in table like in example 1
Create tween using tweenInfo and setting the property to the position + offset
Play all the tweens (or return them all in a table)