- Home /
Can I have multiple mesh altering scripts on an object?
Hi All Hoping someone can help me out here, I have a script that alters a mesh and it all works fine but if I add another script to the same object that also works on the mesh then that mesh doesnt work, but if I disable the one added before it does work. Is there a way around this?
I tried the Procedural examples given by Unity as well and they suffer from the same effect, ie add a single twist script to a mesh and it works fine, add another to the same mesh and the first one works but the second has no visual result until the first one is disabled.
Can this be solved? Or is a limit of the script system?
Thanks Chris
Are you suggesting you want to blend the two together or override the first. Besides for the performance issue with iterating through the mesh multiple times (which Unity handles generally well). $$anonymous$$aybe try putting the second one in LateUpdate.
Answer by StephanK · Aug 04, 2010 at 11:12 PM
I don't know if this works or not, but having two different scripts manipulating the same mesh seems to be a bad idea, as you don't have any control over the order of execution. Maybe it's a better idea to combine the two scripts into one?
$$anonymous$$mm order shouldnt be an issue at all, I can combine my scripts but just thought it could be handy to be able to drop multiple scripts onto a mesh and they all work.
Your answer