when disable a shape been told that shape not exist in space

Chipmunk2D Bindings for the Unity3D engine
Post Reply
compass3
Posts: 37
Joined: Fri Aug 30, 2013 4:27 pm
Contact:

when disable a shape been told that shape not exist in space

Post by compass3 »

Hi,

I was disabling a shape, and the chipmunk told me that shape does not exist in the space.
Does this mean chipmunk do not allow disabling a disabled shape? even if I just want to disable it many times?
compass3
Posts: 37
Joined: Fri Aug 30, 2013 4:27 pm
Contact:

Re: when disable a shape been told that shape not exist in s

Post by compass3 »

It may be a bug caused by unity. Since I find Unity will not call OnDisable() function unless it thinks the object is enabled and should disable.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: when disable a shape been told that shape not exist in s

Post by slembcke »

Hmm. That's possible. Unity's criteria for calling the different object lifecycle methods is surprisingly complex. (If they are called, and in what order) The documentation doesn't cover a lot of the details so you have to figure it out by trial and error.

Any hints about how to reproduce it would be helpful.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
compass3
Posts: 37
Joined: Fri Aug 30, 2013 4:27 pm
Contact:

Re: when disable a shape been told that shape not exist in s

Post by compass3 »

I do not know which reason cause this bug. I tried to reproduce many times, the bugs happened. But not because of I added many lines of code that disabling a same shape. The Unity seems to ignore duplicated disabling. However, it will still happened to disable a disabled object, and I do not know what caused that. And I checked the stack of function calls, the OnDisable function was called from the same code that disable the shape.
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests