feat:(game) added a reset button to avoid reload

pull/3/head
Alex 2024-02-02 11:54:29 +01:00
parent 51c2f3f8f8
commit 8138f4338f
1 changed files with 10 additions and 0 deletions

View File

@ -397,6 +397,16 @@ export const PlayerController = () => {
if(resetPressed) {
body.current.setTranslation({x: 8, y: 2, z: -119});
body.current.setLinvel({x: 0, y: 0, z: 0});
body.current.setAngvel({x: 0, y: 0, z: 0});
setCurrentSpeed(0);
setCurrentSteeringSpeed(0);
setIsBoosting(false);
effectiveBoost.current = 0;
setIsOnGround(false);
jumpForce.current = 0;
driftDirection.current = 0;
kart.current.rotation.y = Math.PI / 2;
}