[LayaAir 2.0]物体碰撞问题


问题.png
		var box_1 : Laya.MeshSprite3D = this.scene.addChild(new Laya.MeshSprite3D(Laya.PrimitiveMesh.createBox(1, 1, 1))) as Laya.MeshSprite3D;
box_1.transform.translate(new Laya.Vector3(0, 5, 0));
var boxRigidBody_1 : Laya.Rigidbody3D = box_1.addComponent(Laya.Rigidbody3D);
var boxShape_1 : Laya.BoxColliderShape = new Laya.BoxColliderShape(1, 1, 1);
boxRigidBody_1.colliderShape = boxShape_1;
boxRigidBody_1.mass = 10;

var box_2 : Laya.MeshSprite3D = this.scene.addChild(new Laya.MeshSprite3D(Laya.PrimitiveMesh.createBox(1, 1, 1))) as Laya.MeshSprite3D;
box_2.transform.translate(new Laya.Vector3(4, 5, 0));
var boxRigidBody_2 = box_2.addComponent(Laya.Rigidbody3D);
var boxShape_2 : Laya.BoxColliderShape = new Laya.BoxColliderShape(1, 1, 1);
boxRigidBody_2.colliderShape = boxShape_2;
boxRigidBody_2.mass = 1;
box_2.addComponent(BoxMoveScript);
创建两个Box 但是碰撞的时候会撞进去,为什么会这样呢
已邀请:

要回复问题请先

商务合作
商务合作