just noticed we should start a new thread, so I will do this posting my question from the very long dusk thread here
I’m playing around with Dusk right now and encountered a strange error:
I’m using physics and when the screen is touched applyForce to an object to move it on the x axis. The camera is moving with the object when it is moved. When applyForce is used and the object is moved the following error is stopping the movement after about 1 second:
Attempt to compare nil with number
Dusk/dusk_core/misc/functions.lua:49: in function ‘clamp’
Dusk/dusk_core/run/camera.lua:212: in function ‘processCameraViewpoint’
Dusk/dusk_core/run/update.lua:112: in function <Dusk/dusk_core/run/update.lua:111>
?: in function <?:205>
Any idea what I have to look at to fix this?
Somehow it seems like the map.setCameraFocus is causing the problem. When turned off everything works fine BUT when turned on it looks like the error appears exactly where the object normally would leave the screen (when the cam movement is turned off). Can it be a object culling problem?
I still can’t figure out the problem (see last post). It looks like a culling problem with the object. The camera is holding the object in the center of the screen, but the error appears when the map (background) is moved the distance from the centered object to the screen borders. It seems like the object is “culled” even when the camera is following the object and keep it centered. Could this be it?
Can you please help me solve this?