Level up solutions:

The working solution I’ve found for my first problem is relatively simple. In the if statement which tests whether the avatar is within a new level bracket I can add  “camStage !== 1” as a third query and then inside the statement change the camStage var to equal 1. This solves the problem of repeatedly being called.

The solution to the camera jumping however is not so simple, within three.js there is no way to animate the position of an object. I have done some searching around the internet and it appears that there is a library for javascript called Tween.js which can animate property of objects, both CSS and that of 3D libraries like three.js.

Leave a comment