Hello Guest

Author Topic: Can animated sprite do polygon collision?  (Read 5000 times)

Tongie

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 23
    • View Profile
Can animated sprite do polygon collision?
« on: September 20, 2012, 05:10:49 pm »
My animated sprite define collider type as polygon dont collide with a sprite that define collider type as polygon.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Can animated sprite do polygon collision?
« Reply #1 on: September 20, 2012, 11:54:15 pm »
In Unity, only convex mesh colliders can collide with other mesh colliders. That means one of them will need to be tagged as convex, ideally the moving one.

Also, please note that you can't animate polygon colliders right now - they are very very expensive to change. You can move them, just not have frame animation on them.

This is a limit of the Physx engine used by Unity.

Tongie

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Can animated sprite do polygon collision?
« Reply #2 on: September 21, 2012, 03:55:32 am »
oh ok i checked convex but when i pressed play it auto uncheck. how do i make 2 circle collide? one sprite , one animated sprite.

Tongie

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Can animated sprite do polygon collision?
« Reply #3 on: September 21, 2012, 03:58:31 am »
Btw thanks for the information...I solved it. Need to check the convex inside the spritecollection editor not on the inspector.

Kennn

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Can animated sprite do polygon collision?
« Reply #4 on: October 03, 2012, 06:38:43 am »
Hi, just to be clear-- It's okay to animate a sprite with a polygon collider as long as the polygon is the same for each frame?  Or will even that cause a problem?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Can animated sprite do polygon collision?
« Reply #5 on: October 03, 2012, 10:19:47 am »
Animating the collider if its the same each frame is fine, but you should set it up that the first sprite has the collider and everything else is set to Unset, so they don't try to change it.