Scenekit: Crash when Setting physicsBody to nil

48 Views Asked by At

Can anyone help on this one: Still coding on my game App in a tunnel cave, I installed moving walls within a not-moving frame. The good thing is that I can move the walls within the parent nodes (the frames). Bad thing is, I need to set a physicsBody physicsShape - for the frame a concavePolyhedron, while for the wall a boundingBox does the job. Now, when I try to remove the walls, the scene crashes with a BAD_EXEC. I tried a lot of different things to find out why, and as it turns out, the childNode walls seem to be the problem. Because, even though it is possible to set the parent physicsBody to nil, the app crashes when I do the same thing with the childs (the walls). No matter if the nodes are hidden or not, and no SCNAction is attached. I found a similar question, in which an answer was provided in C++, a command called ‚cleanUpChildrenAndRemove‘, but I am coding in Swift and there doesn‘t seem to be an analog. I am pretty sure something is messed up, but I have no idea what it could be or how to straigthen it. Does anyone have the same issue or know an answer?

0

There are 0 best solutions below