Issues tweening a model

Maybe tweening isn’t the best solution for what you are trying to do.
You say the model has lights and chairs etc…, what exactly are you trying to tween, and what is the effect you are trying to achieve, in other words why are you tweening it?

Maybe you could simply move the model by cframe with some sort of easing algorithm.

Got the error: Expected BasePart got Model for WeldConstraint:Part1.

How would I do that?

Well, first, what is this model, and what is the effect you want?

Will it need collision or not?

1 Like

Certain parts have collisions, like the frame and stuff, and some don’t, like the doors and such.

Would I have to move the primary part with like cframe?

Are you tweening a building? Why do you need to tween it?

I’m tweening a train model. Not a building.

You can move an entire model using model:PivotTo(cframe)
The cframe is where you will want to move it to.

I can’t provide any code, so this might be hard to explain.

You determine the ending cframe, call it endCF then you determine the amount of time you want the
model to move to the destination say… duration

Then you need to have a loop, that counts Counter from 0 to duration and gets the position of the cframe with cframe:lerp, or an easing algorighm, by taking the current Counter/duration as the current position in time, and use the PivotTo to place the model at that location.

Sorry if this isnt much help, got a birthday party to take my kid to, or I would type up something.

I need it to move though, not just infinitely teleport.

Have you thought about using a linear velocity to push the train along a track?

No, I don’t even know how to do that.

See if this post has any information that might help you.

I hate to be one of those people, but you should try to search these forums for words like ‘move model along path’ or ‘move train along track’ or even goole those things.

I always hate it when someone tells me to google stuff, as I am notoriously bad at finding anything through search engines, and I also feel a bit offended, like ‘how do they know if I have or have not searched all over creation already’

All that aside though, usually when I take the advice and search for things, I tend to find a lot of good resources and even unexpected gems of code and knowledge. Happy hunting.

2 Likes