Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Error when using sprite shape with colliders

Discussion in '2D' started by ZygoUgo, Mar 3, 2020.

  1. ZygoUgo

    ZygoUgo

    Joined:
    Jul 11, 2017
    Posts:
    63
    InvalidOperationException: The previously scheduled job SpriteShapeGenerator writes to the NativeArray SpriteShapeGenerator.m_ColliderPoints. You must call JobHandle.Complete() on the job SpriteShapeGenerator, before you can read from the NativeArray safely.

    I have the set-up baking colliders, although I'm using sprite-shape just for the colliders and not the sprite abilities, any one got any ideas? Thanks for any help! :)
     
  2. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    618
    Hi, are you removing the SpriteShapeController component once you bake the collider ?
     
  3. ZygoUgo

    ZygoUgo

    Joined:
    Jul 11, 2017
    Posts:
    63
    No, i've found it's something to do with the option to update the colliders, if I switch that off it works, but I still get the same error
     
  4. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    618
    Could you post a repro project? That would be helpful as not exactly sure what you are trying to achieve.
     
  5. ZygoUgo

    ZygoUgo

    Joined:
    Jul 11, 2017
    Posts:
    63
    I have large handdrawn sprites as my platforms, but I am using spriteshape without the sprites as the colliders. It seems that the 'Update collider' option was causing an issue, so I built the spriteshapes then switched update to off, which seems to have fixed the problem. Is this something that needs looking at for Unity's benefit?
     
  6. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    618
    It would be nice if you could provide a simple repro project or create a fogbugz case. We will take a look asap. Thanks.
     
  7. ZygoUgo

    ZygoUgo

    Joined:
    Jul 11, 2017
    Posts:
    63
    Okay, I'll look at that tomorrow :)
     
  8. ZygoUgo

    ZygoUgo

    Joined:
    Jul 11, 2017
    Posts:
    63
    Hi, I have built a basic scene but don't seem to be getting the same error, I'll attach it here anyways so you can see how I'm using the Sprite Shape collider. I have quite a lot of assets so it could be one of those clashing, I'll have to try adding them one by one and see if the error re-appears. The included project example contains the Corgi Engine which makes it too large to upload here, I have deleted the unnecessary example scenes to make it smaller, and the library, but it's still too large, do you have an email I can post to via WeTransfer? It's around 261MB zipped.