# The Output says no!

**URL:** <https://talk.code3dgames.com/t/the-output-says-no/412>\
**Category:** Uncategorized\
**Created:** [November 12, 2021, 7:19pm UTC](https://talk.code3dgames.com/t/the-output-says-no/412 "2021-11-12T19:19:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin](https://talk.code3dgames.com/user_avatar/talk.code3dgames.com/martin/32/41_2.png) [@Martin](https://talk.code3dgames.com/u/Martin)\
**Post date:** [November 12, 2021, 7:19pm UTC](https://talk.code3dgames.com/t/the-output-says-no/412/1 "2021-11-12T19:19:04Z")

</div>

code.html:163 Uncaught ReferenceError: riverPoints is not defined  
at addPowerUp (code.html:163)  
at resetPowerUps (code.html:154)  
at reset (code.html:132)  
at code.html:42  
at \_.html:9  
Wth.  
I dont understand it.  
RiVeRpOiNt Is NoT dEfInEd…  
WHY.  
url:)[https://is.gd/SgeNuY](https://is.gd/SgeNuY)

---

<div class="post-metadata">

**Author:** ![chris](https://talk.code3dgames.com/user_avatar/talk.code3dgames.com/chris/32/5_2.png) [@chris](https://talk.code3dgames.com/u/chris)\
**Post date:** [November 16, 2021, 3:59am UTC](https://talk.code3dgames.com/t/the-output-says-no/412/2 "2021-11-16T03:59:55Z")

</div>

The `addPowerUp()` function is missing the `riverPoint` argument. It should start as: `function addPowerUp(riverPoint) {`. There are a couple of minor typos inside the function as well. The variable `riverPoints` (plural) is used, but it should be just `riverPoint`. And the line that defines `shape` should be `THREE.SphereGeometry` (it is missing and `e` in the shared code).

The entire function should read:

```auto
function addPowerUp(riverPoint) {
  ground.updateMatrixWorld();
  var x = riverPoint.x + 4 * (Math.random() - 0.5);
  var y = riverPoint.y;
  var z = -0.5;
  var p = new THREE.Vector3(x, y, z);
  ground.localToWorld(p);
  
  var shape = new THREE.SphereGeometry(0.25, 25, 18);
  var cover = new THREE.MeshNormalMaterial();
  var mesh = new Physijs.SphereMesh(shape, cover, 0);
  mesh.position.copy(p);
  mesh.powerUp = true;
  scene.add(mesh);
  
  mesh.addEventListener('collision', function() {
    for (var i=0; 1<scene.children.length; i++) {
      var obj = scene.children[i];
      if (obj == mesh) scene.remove(obj);
    }
    scoreboard.addPoints(200);
    scoreboard.message('Lecker!');
    setTimeout(function() {scoreboard.clearMessage();}, 5*1000);
  });
}

```
