Hello Guest

Author Topic: Static Sprite Batcher and Colliders?  (Read 3734 times)

wubak

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Static Sprite Batcher and Colliders?
« on: September 04, 2012, 05:36:16 am »
I've got a setup with a character controller on a moving sprite and a number of motionless sprites with box colliders. All of the collisions work perfectly.

However, when I place the stationary sprites into a static sprite batcher and commit, the colliders disappear. I do have the sprite's collider marked as  unset in its collection. This is because I'm doing custom scalings box collider settings for each instantiation of the sprite.

Any suggestions?
« Last Edit: September 04, 2012, 06:01:09 am by wubak »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Static Sprite Batcher and Colliders?
« Reply #1 on: September 04, 2012, 06:10:06 pm »
It is  not possible to read individual collider scaling - the static sprite batcher simply stores the sprite Id in there to save memory. You could in theory work around this by creating duplicates of the same sprites in the sprite collection with different collider set ups on each. The texture only gets put in the atlas once if you do this.