xx 1 year ago
parent
commit
bf295ec800
1 changed files with 2 additions and 2 deletions
  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){
                 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
                     x = right_x-5
                 }
                 }
                 if(x>=right){
                 if(x>=right){
-                    x = this.node.position.x
+                    x = right-size.width*0.5
                 }
                 }
             }
             }