2D Toolkit Forum

2D Toolkit => Support => Topic started by: cortheya on February 20, 2013, 10:00:06 pm

Title: Question: How to collide animated sprites?
Post by: cortheya 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?
Title: Re: Question: How to collide animated sprites?
Post by: unikronsoftware on February 21, 2013, 11:55:28 pm
Do you have a rigidbody (set to kinematic) on your animated sprite?
Title: Re: Question: How to collide animated sprites?
Post by: cortheya 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.
Title: Re: Question: How to collide animated sprites?
Post by: unikronsoftware 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.
Title: Re: Question: How to collide animated sprites?
Post by: cortheya on February 25, 2013, 12:03:16 am
Finally got it working, thanks a lot!