I would recommend putting my Module in ReplciatedStorage, but ServerStorage and ServerScriptService are fine if you dont want to tween models on the Client.
Once you have my module all set up, write this line of code:
local TweenModelService = require(game:GetService("ReplicatedStorage").TweenModelService)
You then can treat it exactly like you would with TweenService.
It welds every part together with WeldConstraints to the PrimaryPart, and moves the PrimaryPart to the goal. Once ModelTween:Destroy() is called, it will clean up the welds for you.
Let me know what you think, or if you found this useful, or if you have an update request.
This is (somewhat) of a clanky way for animating models. I’d actually recommend using AnimationControllers when possible because they’re both pre-baked and already host internal replication
Of course, when that’s not a viable option or you just don’t want to deal with dumb Roblox bugs this module is very well-made for what it’s worth. Good job!
I appreciate the effort, but why would you use an outdated approach? Instead of using welds, just set the pivot of the model using model:PivotTo(cFrame).
I’m not sure that’s correct. I made a module for tweening PVInstances based on their Pivot points before, and it ended up smooth no matter the framerate. My solution was to use a ghost part, tween that, and then call PVInstance:PivotTo(ghostPart.CFrame) every frame.
It’s far from optimal, but it worked smoothly and consistently, even on clients with unlocked framerates.
Isn’t this just the same as TweenService? You are still asking for the tween info, and have the exact same functions. It’s not easier in any way to use this.
It’s not meant to be easier to use than TweenService. It’s meant for tweening models - which have no properties TweenService can directly interact with.
For anyone suggesting PivotTo(), CFraming the rootpart of a welded model is a lot better for performance. The reason is probably that the engine is optimized for moving welded models, whereas moving parts individually is slow. PivotTo() becomes significantly slower when moving models with a lot of unwelded parts, where a welded model doesn’t
(Also, changing the CFrame property or using PivotTo() is what causes a majority of the lag when moving parts around. For the best performance, BulkMoveTo() can be used on the rootpart of a welded model)
This isn’t something that can be found in the documentation, you have to test the performance yourself to figure this out
Also, using PivotTo() can give a smooth result if implemented correctly, but it will consume more resources on the player’s computer
I also thought of another optimization strategy:
What about rigging the Model & playing an animation locally on the client, I e.g. used that for spin / Ufos