Page 1 of 1

!space->locked. Crash in the project.

PostPosted: Tue Aug 09, 2016 12:31 pm
by yomanx
hi friends!

In my game i meet different crashes because:

in debug info i can see:

Code: Select all
cpAssertHard(!space->locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete.");


* cocos2d makes impossible to control the locks.

1. How correctly to wait when the SPACE will be unlocked?

2. when we have collision we continue to control the body or sprite with body

Re: !space->locked. Crash in the project.

PostPosted: Tue Aug 09, 2016 3:45 pm
by slembcke
The API Chipmunk provides to handle this sort of thing natively is called post step callbacks. Is that exposed at all?

Otherwise you'll need to build a list of actions or something that you need to handle later after the collision phase has ended. It's not hard, but it is quite tedious.