Hello Guest

Author Topic: Sprites keep disappearing in edit mode, reappears after recommit  (Read 15918 times)

arvz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 21
    • View Profile
Hello,

Some of my tk2dsprites constantly stop being rendered in edit mode after pressing stop during play mode in the editor - though they are still there - you can still click on it, and the collider borders appear, but the sprites are invisible. They do appear in play mode, and will reappear if I recommit the sprite collection - but they disappear again after I finish running the game.

This seems to only happen to a couple of sprites, there are other sprites in the scene from the same sprite collection that is not problematic at all.

Edit: I seem to have fixed it by deleting the sprites and readding them again, but I feel like it could happen again in the future

Any ideas what it could be?
« Last Edit: April 26, 2014, 04:49:37 pm by arvz »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #1 on: April 26, 2014, 07:43:08 pm »
It shouldn't do this. This only happens when something has broken with the collection.
If it ever happens again, please post a repro case so I can work out why its happening.

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #2 on: July 02, 2014, 07:01:14 pm »
Posted in the other thread, but gonna post here as well. This happens to me also. Some sprites, re-adding them temporarily fixes it. Seems to be because of the prefab it's connected to.

2dddd

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #3 on: July 24, 2014, 07:38:41 pm »
The same thing keeps happening to me. I noticed that when the sprite will not show in edit mode, the Mesh Filter component in the Inspector shows "Missing (Mesh)" for the Mesh drag-and-drop box. But when the sprite appears again, the drag-and-drop box shows a symbol for the mesh as it should. I don't know why it would be doing this seemingly randomly. I'm using a Mac by the way.
« Last Edit: July 24, 2014, 08:06:48 pm by 2dddd »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #4 on: July 25, 2014, 06:44:46 pm »
Can you create a prepro for this? The last time I saw a repro for this, Unity was being very naughty and overriding values on the sprite from the prefab AFTER OnEnable / Awake / Start were called. Unity seems to get into this state, its not reproducible on normal projects - I'd be interested in finding out why it happens.

robertwahler

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #5 on: July 29, 2014, 11:10:17 pm »
This is happening to me too. I just updated to Unity 4.5.2, it doesn't happen in Unity 4.3.  I'm going to have to roll back to Unity 4.3 because some sprites are missing and the "Mesh Filter" says "None" only on the missing sprites. If I change any sprite property, the sprite shows up again until I press the run button.  Pressing the run button make the sprites disappear again.

Everything works fine if I create a standalone build. The problem only shows up in the editor.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #6 on: July 30, 2014, 12:28:41 pm »
This is really annoying, it looks like they may have changed how prefabs work again :(  I can't reproduce this specific issue though, can you create a repro?

mangoocean

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #7 on: August 02, 2014, 03:47:29 pm »
+1 here too. Only started happening since the update

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #8 on: August 03, 2014, 12:19:05 pm »
Please post a repro for this.

wtrebella

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #9 on: August 07, 2014, 05:13:19 am »
Hey so I was having the same exact problem and I finally figured out how to repro it. I just tried it multiple times, exactly as written below, and it worked every time.

Unity 4.5.2f1 (pro)
2D Toolkit 2.4.0
Mac OSX 10.9.3
2013 27" iMac

  • Create a new project
  • Import 2D toolkit
  • Delete Main Camera
  • Create a tk2dcamera from the Create dropdown in the Hierarchy
  • Import a texture (I just imported a white square png)
  • Create a new Sprite Collection
  • Set the Sprite Collection Physics Engine type as Physics 2D
  • Add your imported texture to the collection
  • Set the sprite's collider type as Polygon
  • Commit Sprite Collection
  • Create new tk2dSprite in scene using the Create dropdown in the Hierarchy, and set it to the sprite you created
  • Drag the sprite in the scene to the Assets folder to create a prefab of it
  • Open the Sprite Collection editor and commit it again
  • Press play, then stop
  • Sprite disappears from scene in edit mode

Please let me know if you're able to repro!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #10 on: August 10, 2014, 12:47:17 pm »
Sorry, I can't reproduce this issue following the steps above - almost identical specs, apart from I'm running on a 2013 Macbook Pro. can you zip up the project and send it my way when its broken?

wtrebella

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #11 on: August 19, 2014, 04:15:15 pm »
Oops, didn't see that you had responded, sorry. Yeah here you go. [removed link]
« Last Edit: August 20, 2014, 12:33:49 pm by unikronsoftware »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #12 on: August 20, 2014, 12:35:14 pm »
So in this example, it draws the sprite when you've pressed play but is invisible in the editor?
This is because of that change to the prefab system I mentioned before. I can add a "rebuild all sprites" button in Unity to have them draw in scene view, if that will help?

wtrebella

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #13 on: August 20, 2014, 03:18:48 pm »
A "rebuild all sprites" button would be great. Ideally, the way prefabs are handled would be fixed, but I understand that may not be possible. A button to rebuild sprites would be a wonderful temporary solution. Thanks!

Callabrator

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Sprites keep disappearing in edit mode, reappears after recommit
« Reply #14 on: October 27, 2014, 06:53:32 am »
I just wanted to add that I'm seeing, what I think is, exactly the same problem after upgrading from Unity 4.3 to 4.5.4.  The Mesh Filter and the Material get set to "None" on random sprites in my scene.  Playing the scene in the editor sometimes makes those reappear, but also often breaks others.  The sprites all appear to be fine when running on an iPhone.

Has there been any movement on this issue?  Did the "Rebuild All Sprites" button make it into any 2dtk 2.5.x beta release?