Sign in to follow this  

Chipmunk sensors?

Recommended Posts

The problem is that I want sensors for triggers or for collecting "coins" or reaching the goal. So I do this:
if (trigger)
     shape->sensor = 1;

The problem is that when I declare it as a sensor Chipmunk doesn't generate a callback all other code is the same except that line. When I remove that line Chipmunk generates callbacks but it also creates a collision response(the ball bounces back from the coin). This is how I declare callbacks:

I only call cpSpaceSetDefaultCollisionHandler function once. I use Chipmunk 5.2.0(I also tried with 5.0.0) and Xcode(GCC).

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this