Search Unity

Bug Sprite Shape disappearing on Play after checking Cache Geometry

Discussion in '2D' started by AlanPereiraArt, Apr 18, 2021.

  1. AlanPereiraArt

    AlanPereiraArt

    Joined:
    Apr 29, 2014
    Posts:
    17
    Hello,

    I am working with Sprite Shape Renderer and when I check the Cache Geometry, on Play and on Build it doesn't appear. it seems the Data wasn't stored.

    It is just a simple scene I was making to teach my students how to use this feature.

    upload_2021-4-18_15-19-32.png

    How it was supposed to be:
    upload_2021-4-18_15-20-14.png

    Some error that are thrown (without Cache Geometry being checked):
    upload_2021-4-18_15-23-19.png

    With it checked:
    upload_2021-4-18_15-24-13.png

    Both errors happens when hitting Play.

    Unity Version: 2020.3.4f1
    Sprite Shape Package Version: 5.1.1

    I tried to search any related stuff, watched the optimization guides to check if I was missing a step but couldn't find anything related. Sorry if it is a duplicated topic.

    OBS.:
    I tested with the Lost Crypt project on Unity 2019.4.12f1 with Sprite Shape Package on 3.0.14 version and the issue doesn't happen.
     

    Attached Files:

    Last edited: Apr 18, 2021
  2. ed_s

    ed_s

    Unity Technologies

    Joined:
    Apr 17, 2015
    Posts:
    165
    AlanPereiraArt likes this.
  3. AlanPereiraArt

    AlanPereiraArt

    Joined:
    Apr 29, 2014
    Posts:
    17
    @ed_s Thanks for the quick reply.
    It really seems related, just the "action" that triggers the error that is different. On the Issue Tracker it says when disabling the Edit Shape and for me it was when entering Play Mode.
    But maybe I didn't paid attention if actually I hit play with Edit Shape activated and by changing to Play Mode it disabled it, causing the "action" to be the same.

    As soon as I return from work, I will send the Bug Report from the project on my machine.
    I didn't tested in a new project, but in theory this issue could be reproduced by:
    1. Creating a new project on 2020.3.4f1 with a 2D Template;
    2. Check if the current 2D Sprite Shape package is indeed the 5.1.1 on the Package Manager;
    3. Create a Sprite Shape on the SampleScene;
    4. Select Edit Shape on the Sprite Shape Controller and enable the Cache Geometry option;
    5. Enter Play mode.
    Obs.: I will test it in a new project before sending the BugReport.
    _______

    Aside that, do you have an estimate date for when 5.1.2 for this package might be released?
    I am not aware on the update cycle for packages.
     
  4. Sality

    Sality

    Joined:
    Dec 16, 2013
    Posts:
    21
    @ed_s Perhaps you can tell me if caching will solve the problem with the spike in the profiler?
    Checking the geometry cache has no effect.
    Unity 19.4.24 SpriteShape 3.0.15

    upload_2021-4-22_17-44-2.png
     
    Last edited: Apr 22, 2021
  5. AlanPereiraArt

    AlanPereiraArt

    Joined:
    Apr 29, 2014
    Posts:
    17
    I just sent a new bug for verification, but as already stated the two bugs may have the same solution.

    To update, I just created a new Project with the 3.0.14 package and it worked fine.
    As soon as I updated to 3.0.15, the problem emerged. Console.

    Some screenshots:
    - 3.0.14 with Cache Geometry
    teste spriteshape cache geometry 3-0-14.png

    - 3.0.15 with Cache Geometry
    teste spriteshape cache geometry 3-0-15.png

    - 3.0.15 without Cache Geometry
    teste spriteshape NO cache geometry 3-0-15.png

    Errors on the Console:
    teste spriteshape cache geometry 3-0-15 errors.png
     
  6. Sality

    Sality

    Joined:
    Dec 16, 2013
    Posts:
    21
    I have the same bug Unity 19.4.25 spriteshape 3.15 I have big spikes in the profiler. after I put the cache, the peaks disappear, but the graphics are not displayed like yours
     
  7. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    644
    @AlanPereiraArt @Sality
    This issue has been fixed and will be published soon 3.0.16
    Will post an update here as soon as its published. Sorry for inconvenience caused.
     
  8. AlanPereiraArt

    AlanPereiraArt

    Joined:
    Apr 29, 2014
    Posts:
    17
    The fix will also happen for the 5.1.2?
     
  9. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    644
    Yes, the fix will be available in 5.1.2 as well. Will post an update once its published.
     
  10. Sality

    Sality

    Joined:
    Dec 16, 2013
    Posts:
    21
    @Venkify
    Sorry for my impatience, maybe you know at least the approximate dates when the update can be released, I want to plan it will have time to go to the beta test of my game. within a week or a month at least approximately?
     
    Last edited: May 17, 2021
  11. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    644
    @Sality @AlanPereiraArt
    Update : Version 5.1.2 is available now.
    Will post an update here as soon as other versions with the fix are published. Thanks.
     
  12. Sality

    Sality

    Joined:
    Dec 16, 2013
    Posts:
    21
    Sorry )) but how your coders maked and testers tested i don't understand. If we use one object all work right?
    but what if we make multiple objects
    ))))) :
    1. Creating a new project on 2019.4.25
      1. Creating a new project on 2019.4.25f1 with a 2D Template;
      2. Check if the current 2D Sprite Shape package is indeed the 3.0.16 on the Package Manager;
      3. Load example project from Sprite Shape package;
      4. dublicate test geometry object and put in inside;
      5. save as prefab.
      6. go to prefab and enabled geometry cash.
      7. in play mod geometry no show
     

    Attached Files:

  13. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    644
    @Sality Could you please post a sample repro project with detailed steps ?

    Here is a quick demo with 3.0.16 tested in latest 2019.4. We could not reproduce what you posted. Thanks.

    SpriteShapeTest.gif
     
  14. Sality

    Sality

    Joined:
    Dec 16, 2013
    Posts:
    21
    Last edited: May 28, 2021
  15. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    644
    Thanks for posting repro project. Please note that SpriteShape geometry cache only gets saved when you enter Edit mode for SpriteShape. It seems the Prefab does not have valid cached data. Hence you may need to Open Prefab to Edit and enter Edit mode for each SpriteShape in the prefab to update/save the Cache. Please check the enclosed demo.

    Alternatively you can also use the attached Editor script to automate this. Open the Prefab, select the Root GameObject and click "Assets/Cache SpriteShape Prefab" from the Menu. This should also update the Cache. This is also shown at the end of the Demo.

    Apologies for any inconvenience caused.
     

    Attached Files:

  16. Sality

    Sality

    Joined:
    Dec 16, 2013
    Posts:
    21
    Thank you very much, your script really helped us, we have dozens of shapes and it takes a very long time by hand.
    And the lag with the garbage collector disappeared. Thank you so much.
     
  17. MassiveMonsterGames

    MassiveMonsterGames

    Joined:
    Aug 4, 2016
    Posts:
    12
    We have 3.0.17 and still getting this issue, Unity Version 2019.4.20f1 spriteshapes are in prefabs and have gone in and out of the edit spline to cache them.