xx 1 年之前
父節點
當前提交
bf295ec800
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      assets/script/game/car.ts

+ 2 - 2
assets/script/game/car.ts

@@ -357,7 +357,7 @@ export class car extends Component {
                 }
 
                 if(x<=left){
-                    x = this.node.position.x
+                    x = left+size.width*0.5
                 }
             }
 
@@ -368,7 +368,7 @@ export class car extends Component {
                     x = right_x-5
                 }
                 if(x>=right){
-                    x = this.node.position.x
+                    x = right-size.width*0.5
                 }
             }