我只是为我的游戏设置了一个边界,它似乎工作正常,直到它真的被迫,因为我让我的角色向它跑了几秒钟,然后我的角色将直接通过。对此的任何解释以及我如何解决它?
编辑: 这是我的边界代码
function myFunction() {
var a,csv,data,fromS3,i,L,L2,lastRow,liquidityBalance,
outerArray,row,s3,thisRow;
liquidityBalance = SpreadsheetApp.openByUrl(liquidityBalanceSheet).getSheetByName('Liquidity');
s3 = S3.getInstance(awsAccessKeyId, awsSecretKey);
fromS3 = s3.getObject(bucket, file);
data = Utilities.parseCsv(fromS3.getDataAsString(), '\t');
csv = [];
lastRow = liquidityBalance.getLastRow();
liquidityBalance.clearContents();
outerArray = [];
L = data.length;
L2 = data[0].length;//Number of elements in an inner array
for (i = 0; i < L; i++) {
row = [];//reset on every loop
thisRow = data[i];
for (a = 0; a < L2; a++) {
row.push(thisRow[a]);
}
outerArray.push(thisRow);
}
liquidityBalance.getRange(lastRow + 1, 1, outerArray.length, L2).setValues(outerArray);
}
答案 0 :(得分:0)
尝试为ship
:
ship.physicsBody?.usesPreciseCollisionDetection = true
您也可以考虑在边界添加物理类别。