I have realy strange problem which accured after adding animator(I suppose) to prefab Object. Situations looks like follow:
I had object which have only sprite renderer, collider2D and script (movement behaviour) attached. It worked perfect on editor mode, ramote or any kind of platform (PC/Mobile). Then I added animator controller and some animations. Everything looked good until I made build for android.
First problem occured and it manifested as follows: when I spawn prefabObject described above game stuck and reset player position to 0,0 (by the way this object spawn at 0,0). The strange thing is that this bug occur onyl on android build. In editor mode, remote and PC build game works perfect. First thing first I though that prefabObj is broken or damaged...so I create new one with same settings and components. Nothing has changed. Situation looks the same.
The second strange thing is that I have another objects with animator and they work properly. But is not over... I updated Unity to newest version to check if its not problem with software. After that it was even worse. Console show me tons of error like: Invalid AABB a and so on. Fortunately I found solution to that. I was problem with particle system attached to some objects. I turn off all particles and I have no more errors...but it makes Unity editor unusalble. Everytime after press play button Unity crash with following message:
unity the memory file is corrupted position out of bounds.
Only way to make unity usable again it was to replace project's file with backup one (with particle system turned on).
After all it does change anything. With old or new Unity version, with or without particle system, problem with game build on android stayed unchanged.
I tried several things like:
- anmation with exit time and witout
- with animation event and without
- with script support
It always looks the same: stabile on editor, remote or PC build but stuck on mobile.
At this moment I totally have no idea what is wrong and how to solve it.
I will be very grateful for any advice, or hint
P.S I don't belive it is a problem with performance. There is no more than 10 objects in one time on screen (2D) and animation is like change scale from zero to one.