Runtime error with callback function

Sharing screenshots of code is no good style. Please use the formatting tools of the forum to share code listings. You can do this by starting and ending a code listing with three ``` signs.

In any event, if you want to transform 3D objects in event listeners, it’s important to store a reference to your model to make it accessible. You can then do stuff like:

button.addEventListener( 'click', function ( event ) {

    if ( model !== undefined ) mode.position.x += 1;

} );
1 Like