Skip to content
On this page


At this point the game is almost playable. We just need to ensure that the puck going out of bounds resets the game.


  1. Duplicate any of the wall.

  2. Remove the mesh component from this wall gameObject so that there is no visible mesh, We only need the collider.

  3. Position and scale it so that it is behind any of the paddle. wall

  4. On the collider component of this wall gameObject, enable Sensor and enable-COLLISION_EVENTS. sensor

Making the collider a sensor ensures that the collider does not actually create reaction forces and enabling the COLLISION_EVENTS allows us to listen for these events.


Add the logic to <projectDir>/src/scripts/wall.ts

// fired because of the collider component
export const collisionEvent = (game, gameObject, {props}, c1, c2, entering) => {
    game.currentGameObject.children.puck.components.rigidBody.setTranslation({x: 0, y: 8, z:0}, true);

Add this script to the wall gameObject and duplicate this gameObject for the other paddle.

At this point the game should be playable.


Setup a way to track score.


Refer to completed project thejsngin/pong3d. If you want a hint.