Hello Guest

Author Topic: Question: How to collide animated sprites?  (Read 5656 times)

cortheya

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Question: How to collide animated sprites?
« on: February 20, 2013, 10:00:06 pm »
I have box colliders on both my background and the animated sprite but it goes through every time I walk over it.. What am I missing?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Question: How to collide animated sprites?
« Reply #1 on: February 21, 2013, 11:55:28 pm »
Do you have a rigidbody (set to kinematic) on your animated sprite?

cortheya

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Question: How to collide animated sprites?
« Reply #2 on: February 23, 2013, 07:06:45 pm »
I do, on both sprites. It's a top down view game and it just walks all over everything.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Question: How to collide animated sprites?
« Reply #3 on: February 23, 2013, 07:10:33 pm »
If you want it to collide, both can't be set to kinematic. Having both of them set to kinematic means you're telling the physics system you want to control movement on both of em - which means they aren't going to collide. They will fire trigger messages, but thats about it. If you want to move both and have em collide, you shouldn't have kinematic set, and use AddForce to move em.

cortheya

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Question: How to collide animated sprites?
« Reply #4 on: February 25, 2013, 12:03:16 am »
Finally got it working, thanks a lot!