Kinematic body & Collision

I have a Kinematic body that I’m animating. I want it to collide with a dynamic body (which is affected by gravity), however I don’t want it to move the dynamic body. (The dynamic body should not be affected by it’s collision)

Can anyone provide some insight into how I’d accomplish this? [import]uid: 4438 topic_id: 3758 reply_id: 303758[/import]

If I understand what you’re aiming for, you should set the kinematic body as a “sensor” (isSensor=true, you can find details in the documentation). The kinematic body, as a sensor, can detect collision with dynamic bodies, but it won’t affect them physically in any way.

Another option is to set up both bodies as dynamic, but use collision filters to dictate that the two bodies never collide physically. You can read about collision filters in the documentation, or you can refer to this post I wrote about it, and the methods I use:

http://developer.anscamobile.com/forum/2010/10/25/collision-filters-helper-chart

You probably should set up collision filters even if you keep the non-affecting body as kinematic. It just ensures that you don’t run into any problems later with unintentional collisions… not to mention, if you filter collisions properly, the engine (probably) doesn’t waste CPU effort on checking those collisions… Ansca, is this true? Do collision filters save processing effort by pre-exempting certain collisions before they are factored into the physics/sensor engine?

Hope this helps!

Brent
[import]uid: 9747 topic_id: 3758 reply_id: 11447[/import]

Awesome. Thank you so much!! That’s exactly what I needed to know!! [import]uid: 4438 topic_id: 3758 reply_id: 11912[/import]