Creating multiple moving parts under the condition of their name?

I basically want to create animated moving clouds under the tween service, I need a couple of clouds to be moving along only the y axis in a repeated loop. I can identify the clouds yet I can’t figure out how to use tween service to move them along the y axis, and keep them in their x and z positions.

This is the code I have currently, it is all functioning and prints, “works” if they are called a cloud.

for _, v in pairs (game.workspace.DoodleBorder:GetDescendants())do
	if v.Name == "Cloud" then
		print("works")
	end
end

I have been looking on the dev forum and the documentation for a while but haven’t found any relevant answer.

To tween them only on the y axis you just need to make the tween goal have the same x and z values as the current(or start) position.

Just stuff you could do to have better performance
Something very helpful you could use for more performant searching is CollectionService(you could tag the items with cloud).
Another way to increase performance is to ditch tween service and use physics based movers(you can just turn off can collide to ensure they reach destination).
I would use AlignPosition for that.

Resources
Collection Service:

Tween Service:

Info on MoverConstraints(physics thing) :

Info on Align Position:

Sounds good, I sorted out CollectionService and that is working, I’m not quite sure how to use the physics aspects though, I looked at a video to summarise how Align Position and general Mover Constraints work, but I’m not to sure on how to apply that to all the models I want if that makes sense? Like if I would have to manually tween every single cloud using the Constraints?

Oh you would have to make an individual constraint for each one, the same as how you have to make an individual tween.

Physics constraints are just more performant than tweens, but you can use either one.

Ah so do I ditch Collection Service then?

Nope, just use collection service to add on all of the constraints.

(loop through all members of a tag and give them constraints)

1 Like

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