Hi there,
I have a game object and I want it to move it the same amount that the camera of the scene moves, so in theory this game object appears as static since is inmediatelly following the camera. I have implemented its update method with the following code:
function update(self, dt)
local camera_pos = go.get_position(camera_id)
local y_position = camera_pos.y
go.set_position(vmath.vector3(self.x, y_position, self.z))
end
The flow of the game is completely vertical, so I only grab the y position of the camera and then I set the position of the object with this value.
The problem is that the object is following the camera but when it moves you can feel it tremble, like if the set_position() method is executed a few milliseconds after the camera move.
Why does this happen?