I tried a thread like this before but it didn’t work. Let me be more on point this time. Utilizing TweenService how would I make the effect of a model falling apart where all the BaseParts in the model fall down in different directions?
Why would you want to use TweenService here? Why not let physics (maybe influenced a bit too) do its thing?
I want the smoothest results and the most control over how it looks.
Could you give a video on how you want it to look like more or less. Maybe that can help a little more.
Yeah TweenService is pretty cool but it’s not always the right tool for the job.
https://gyazo.com/a0b1750c4dd9167fa79a93be759cab41
Here’s a rough example of what I mean but they’d all go in different directions. I might want to do this which physics movers like you said to give an effect of it flying up a tiny bit in a random direction then just fall down.
with tweenservice you will literally have the least control over it
Alright, so you recommend, using adding physics movers to every part with random velocities?
I think, if you’re looking to “model” a breaking-apart effect, you need a “model” to base it off.
If that sounds too simple, all you need to define is a path for your parts to follow. That is basically what TweenService does (with limited funcionality, obviously). But TweenService should be able to handle a simple “fall/break-apart” motion. From the GIF you provided, it seems that you want to use a quadratic-like path.
However, if you are tweening position, you can’t use bodymovers (unless it’s a BodyPosition, but that is really edgy and likely to be a glitchy mess) to augment your path to be more random. So you have to choose between physics-based solutions and the tweening solution (unless BodyPosition somehow isn’t glitchy, which I would encourage you to try out if you have the time for it).
Personally, the tweening solution will give expected behaviour and is one I would side with if I have a path already mathematically defined (but that can be tricky). Otherwise, bodymovers are a good way to do it, but remember that physics isn’t always replicated the same (although in your case, you are ignoring collisions so this shouldn’t really be a problem).
Hope this helps
From this one of the things I got was that TweenService might not be such a bad idea apposed to bodymovers. Do you mean like if I just hopped on to Desmos and made a path for it to follow that would produce similar results but would be harder the calculate compared to just using bodymovers for the movement?
I was literally trying to accomplish this same thing the other day! And it worked pretty easily! ![]()
All you have to do is upload the parts that you want to fall apart into a game, but unanchored. Then have an explosion send them flying into different directions. You can tweak the explosion’s radius and power based on how far you want them to fly.
Make sure you have the parts numbered. Once they’ve exploded, anchor them, make them invisible and paste them into your place with the original parts. You could create one model for LandPoints where the invisible exploded parts are and another for the originals that you want to tween.
Then just run a for loop through all your original parts that tweens each part to its corresponding part in the LandPoints model, by its name. The code would look something like this:
local TweenService = game:GetService("TweenService")
local LandPoints = workspace.LandPoints
local RealParts = workspace.RealParts
local FallInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false, 0)
for _, part in pairs(RealParts:GetChildren()) do
local FallAnim = TweenService:Create(part, FallInfo, {CFrame = LandPoints[part.Name].CFrame})
FallAnim:Play()
end
You could obviously tweak this a bit. Maybe have a math.random() function for how long you want each part to fall for before reaching its destination, I’d suggest.
Good luck!
Ahhhh I remember that thread, yes I believe this may be a good solution.
Also, yes that is sort of what I meant. I actually use Desmos quite a lot to model equations that I use in practice. It is fast and simple, would definitely recommend using it for tweening, trajectories, etc…
But listen to Physicism on this one. There’s a good solution there.
Thanks for the vouch! Decided to put together a video of my outcome with this method. I think it looks pretty good! (I used it on the trowel wall when the energy ball hits it)
This may not be the best solution, but I’ve simulated explosions in the past by performing numerical integration for each part, and adjusting their CFrames accordingly based on velocity, gravity, etc. Be aware that this will become laggy for models with higher part counts.
place demo with script:
break.rbxl (68.9 KB)
link to module:
library/4632682554
After all the helpful suggestions I’m going to go with bodymovers as they will give me the most control.
But shoutout to @Physicism for the really cool TweenService example and cutscene video!