1

That is the error message from Xcode:

-[CCNode setupPhysicsBody:] : Failed to find a parent CCPhysicsNode for this 
CCPhysicsBody. The CCPhysicsBody requires it be the child of a CCPhysicsNode when 
onEnter is called.
CodeSmile
  • 64,284
  • 20
  • 132
  • 217
Canh Tran
  • 298
  • 1
  • 14

2 Answers2

1

Apparently you enabled physics on a node that isn't a child or grandchild of a CCPhysicsNode.

Check all nodes' Physics Item tab to find the one(s) that are not children of a CCPhysicsNode in the scene you are loading.

Note that there is currently a bug that lets you enable physics on the CCPhysicsNode itself, which may also cause this error to appear.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
1

This Warning/error tells you that there is node(s) in your timelines that are not under the Physic nodes. For instance if your Spritebuilder scene contains the following sprites ground, npc, button, background ect. The sprites with physic check up on them must be child of CCPhysicsNode. Picture this as your timeline:

CCNode:

--Background

  • Launcher

  • CCButton

--CCPhysicsNode (Items below have physics checked off on them therefore they must be children of CCPhysicsNode).

  • ground (it requires Physics & it is check off on it).
  • npc (They require physics and have it check off on them).

So make sure if one of your sprite that has physic check off on it is not outside CCPhysicsNode.

webWizard
  • 71
  • 6