I have created a script that does some nifty automatic mesh changes to an asset that is in the heirarchy, and someone presses play. Unfortunately then, I need to change the original transforms on the asset. since when you call RecalculateBounds() and RecalculateNormals() you change the asset.
Thanks!
I’m sorry, to clarify, after the mesh changes in the script, my transform looks funny when you press stop. Is there a way I can change transforms on the asset itself, and subsequently children transforms?
So what you are saying is, when you edit your mesh in play mode and press stop, your assets transform gets all messed up and you want to convert it back?
Do you want to save the mesh deformations, or do you not care?
Maybe you can instantiate the mesh and edit that so the original doesnt get affected (not tested).
No, I would like for the assets transforms to stick when the gameobject was in “play”. my script on awake() handles the mesh and does everything I want the object to do, I also have to move the transform of the object, and its children. when i then press stop, the mesh is still how i wanted it, but then the transform goes back to the original before hitting play. Causing undesired effects. I want the asset as a prefab* to be permanently branded with the transform i gave in awake()