- Home /
Call combine mesh function in parent from end of instantiate script.
I have a script called CombineChildren.CS in parent object, and inside that script is a Combine function.
...
[ContextMenu ("Combine Now")]
public void Combine () {
...
Instantiate.JS script is creating objects inside the parent object, and i want to call Combine() function inside CombineChildren.CS from a line at the end of Instantiate.JS function so it combines after instantiation.
how do i do that?
i've found a workaround for this for the moment... if you use CombineChildren Extended version from the main forums, and set frame delay to 2-3 frames, then the combine happens after the objects are all created.
Answer by Zarenityx · May 02, 2013 at 12:28 AM
What about something like this: (javascript- untested pseudocode)
transform.parent.GetComponent(CombineChildren).Combine();
On the object that is instantated, after everything else is done in the start method.