Collider Working: CC

Hi:

I have 2 nodes that I want to collide, I already added in the Group Manager: player, forestobject to collide. However, player node goes through the forest object node, below it’s my code:

Player:

Blockquote // use this for initialization
onLoad:function () {
var collidemanager = cc.director.getCollisionManager();
collidemanager.enabled = true;
collidemanager.enabledDebugDraw = true;
collidemanager.enabledDrawBoundingBox = true;
// cc.director.getCollisionManager().enabled = true;
// cc.director.getCollisionManager().enabledDebugDraw = true;
this.touchingNumber = 0;
//this.node.Zindex=0;
// this.babychickfollowlocopollitocount=0;
// this.babyblackchickfollowcount=0;
// this.bar=0;
this.node.getBoundingBox();
// this.node.zIndex=1;
var physicsmanager=cc.director.getPhysicsManager();
physicsmanager.enabled = true;

Blockquote

ForestObject

Blockquote
// onLoad () {},
onLoad:function () {
var collidemanager = cc.director.getCollisionManager();
collidemanager.enabled = true;
collidemanager.enabledDebugDraw = true;
collidemanager.enabledDrawBoundingBox = true;
// cc.director.getCollisionManager().enabled = true;
// cc.director.getCollisionManager().enabledDebugDraw = true;
this.touchingNumber = 0;
//this.node.Zindex=0;
// this.babychickfollowlocopollitocount=0;
// this.babyblackchickfollowcount=0;
// this.bar=0;
this.node.getBoundingBox();
// this.node.zIndex=1;
var physicsmanager=cc.director.getPhysicsManager();
physicsmanager.enabled = true;Preformatted text

I have attached Box Collider to both, and a Rigid Body to the player node with Animated chosen. What is wrong?

Thanks and God Bless…

Sincerely,

Sunday

Hi Luke,
Collision manager and physics manager are two seperate things.
You may just use physics manager to handle things.

I’ve recorded a short video to show how it works:

Hope it helps

Hi @ FocusCreative

Thanks for the explanation, really appreciated it. Nevertheless, it’s not working on my end. In fact, if I add a Physics - Rigid Body / Box Collider to the node, it disappears from the screen? Never seen that type of behavior, only if add the regular box collider only, without any physics, it stays on the screen, but still no contact. Kind of frustrating…God Bless…

Sincerely,

Sunday

I don’t know why it happens, it’s weird… Can you pack your project in a zip file and send me to check it?