Now it works as intended and seems super obvious, but it required a few “die & retry” iterations to reach this “stupid & simple” solution (took the wrong path 2-3 times)
In case someone encounters this little specific (but annoying) issue and finds this post:
In the camera script, you calculate the camera position delta (between current and old… old = previous frame):
function update(self, dt)
gp.camPos_delta = gp.camPos - gp.camPos_old
gp.camPos_old = gp.camPos
end
Then in the script of the game object you want to adjust the position, you add this delta:
function update(self, dt)
self.pos.x, self.pos.y = self.pos.x + gp.camPos_delta.x, self.pos.y + gp.camPos_delta.y
go.set_position(self.pos)
end
In the end, you don’t have to check if the mouse is moving or not (which, for some reason, was not 100% accurate and generated sub-issues) since the “camPos_delta” makes the adjustment automatically.