Turn off static -> sprite collisions

Official forum for the Chipmunk2D Physics Library.

Turn off static -> sprite collisions

Postby Droid_999 » Fri Mar 11, 2016 10:29 pm


I have implemented Chipmunk into my top down scroller, and collision detection between the player and static line segments is working very well. But, as part of debugging, sometimes I need to disable the collision on the fly - is there a 'switch' that allows disabling and re-enabling collisions between shapes and static line segments?

Posts: 9
Joined: Sat Nov 03, 2012 5:04 pm

Re: Turn off static -> sprite collisions

Postby slembcke » Sat Mar 12, 2016 1:28 pm

The easiest thing to do would be to the categories/mask feature (Chipmunk 7) or the layers feature (Chipmunk 6). If you zero all of the bits out on your player, then it won't collide with anything. Then you just need to restore the values when you are done.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
Site Admin
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 2 guests