isStatic not fully working... or so it seems.

I’m using isStatic in my code to switch off the Static mode of certain gameObjects at runtime and it appears to be working in that the Static box unticks when I play the game, however the objects are still behaving as though they are Static (i.e., they won’t animate). If I check them off manually in the editor it works as expected.

Any ideas as to why this might not be working for me as expected?

Thanks!

Well that definitely explains why it wasn’t working as expected. Thanks for the reply… I appreciate that! I guess what I need now is to figure out how to switch the objects to “static” mode using an editor script before baking the lightmaps.

I found the following code that should do the trick but can’t figure out how to make it work with tagged objects yet:

GameObjectUtility.SetStaticEditorFlags(go,StaticEditorFlags.LightmapStatic);

If I can get it working then I’ll follow up with the working script.

Thanks again for your help!