Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to wait until a certain child appears in a parent?

Asked by
Scerzy 85
8 years ago

I have this script that moves a part from one model to the other when you touch a button. I also has a script that pertains to this part, but I cannot locate the brick because it doesn't change models at the start of a game.

So for example, think of a ball. It is in a model named "Model1". Now a certain event happens and it moves to "Model2". Now there is another script that has an onTouch function related to the ball. Is there some kind of special way around it like findFirstChild but instead you have to wait for the child to appear? Thanks.

1 answer

Log in to vote
1
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
8 years ago

Very simply, Model2:WaitForChild(childName).

0
Didn't think it'd be that simple. Thanks! Scerzy 85 — 8y
Ad

Answer this question