Hello Guest

Author Topic: [Bug?] - tk2dSprite + Polygon Colliders  (Read 5034 times)

Roamer

  • Newbie
  • *
  • Posts: 10
    • View Profile
[Bug?] - tk2dSprite + Polygon Colliders
« on: December 18, 2013, 07:31:45 pm »
So I have a character that consists of:

  • A sprite from a sprite-sheet with an attached sprite animator.
  • A head that is fixed to an attach-point in the sprite-collection. (The head is not part of the sprite-sheet containing the body, it is a separate, single sprite).

All of my sprites have polygon colliders mapped directly to the sprites edges.

I'm using this script to turn the sprite based on mouse position:



This works.

-> Now the bug is, if the sprite that I'm flipping is in a sprite-sheet and NOT a separate single sprite in the sprite-collection, the sprite flips, but the polygon collider does not. If I manually click FlipX in the editor in scene mode it works fine, as soon as I enter game mode it does not work. Trimmed box works fine.

Also, the head sprite flips fine, so I'm guessing this only happens if the sprite is in a sprite-sheet and has a polygon collider, like I said.

Also, maybe this isn't a bug after all and I'm making some dumb mistake or something, in that case I'd appreciate any input.

As always, thanks in advance!

Roamer

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: [Bug?] - tk2dSprite + Polygon Colliders
« Reply #1 on: December 18, 2013, 07:51:21 pm »
Upon further investigation, this is definitely weird.

Polygon colliders will only flip on calling FlipX or FlipY, IF your are flipping the attached sprite ABOVE it in the hierarchy.

For example, this works, and can be used as a temporary workaround:





This flips "Blank", flipping everything below it. Make sure it has a blank sprite attached that has its attachpoint and anchor point in the same spot.

Is this behaviour wanted or is it really a bug?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: [Bug?] - tk2dSprite + Polygon Colliders
« Reply #2 on: December 19, 2013, 12:01:33 am »
Are you using 2d or 3d colliders? If you can isolate this in a simple test case I'd appreciate a repro case. It may well be a bug, and it will save a lot of time tracking it down if I had a repro to work with. Email support if possible

Roamer

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: [Bug?] - tk2dSprite + Polygon Colliders
« Reply #3 on: December 20, 2013, 01:33:28 pm »
I HAVE to use 3D colliders seeing as the polygon option in the sprite collections generates a mesh collider on the sprite in question, something that isn't possible for RigidBody 2Ds.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: [Bug?] - tk2dSprite + Polygon Colliders
« Reply #4 on: December 20, 2013, 05:05:06 pm »
ok. can you create a repro case for this? If not, I'll have to give you some more things to try and work out what exactly is hapenngin and why.