onCollisionEnter: function (other, self) {
if (other.node.group == “Enemy”) {
var NewEnemyArray=new EnemyArray()
NewEnemyArray.UUID=other.uuid
NewEnemyArray.Enemy=other.node
this.Enemy.push(NewEnemyArray)
console.log(other)
}
},
这个是碰撞检测的地方 然后输出碰撞的物体信息other
uuid
:
“Node.985”
width
:
[Exception: TypeError: Cannot read property ‘width’ of null at cc_Node.get [as width] (http://localhost:7456/app/engine/bin/cocos2d-js-for-preview.js:8195:38) at cc_Node.remoteFunction (
14)]
x
:
[Exception: TypeError: Cannot read property ‘x’ of null at cc_Node.get [as x] (http://localhost:7456/app/engine/bin/cocos2d-js-for-preview.js:8002:35) at cc_Node.remoteFunction (
14)]
y
:
[Exception: TypeError: Cannot read property ‘y’ of null at cc_Node.get [as y] (http://localhost:7456/app/engine/bin/cocos2d-js-for-preview.js:8022:35) at cc_Node.remoteFunction (
14)]
z
:
[Exception: TypeError: Cannot read property ‘z’ of null at cc_Node.get [as z] (http://localhost:7456/app/engine/bin/cocos2d-js-for-preview.js:8042:35) at cc_Node.remoteFunction (
14)]
zIndex
:
(…)
当去看输出信息的时候 进入node的信息 查看xyz都是出现错误 而不是出现信息