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