B
buhalda
Guest
I have a view in a platform game. The players step event calls for a script that does this:
view_xview[0] = lerp(view_xview[0],obj_roofrunner.x-(view_wview[0]/2),0.1)
view_yview[0] = lerp(view_yview[0],obj_roofrunner.y-(view_hview[0]/2),0.1)
view_xview[0] = clamp(view_xview[0],0,room_width-view_wview[0])
basically to follow the player more smoothly. But I also have an inventory object that for the draw event, displays an image over everything you see. My question is, why is it that when I move, the inventory lags behind by a pixel or two ( If I start moving right, it follows you but with a gap of two pixels on the right side of the screen or view).
view_xview[0] = lerp(view_xview[0],obj_roofrunner.x-(view_wview[0]/2),0.1)
view_yview[0] = lerp(view_yview[0],obj_roofrunner.y-(view_hview[0]/2),0.1)
view_xview[0] = clamp(view_xview[0],0,room_width-view_wview[0])
basically to follow the player more smoothly. But I also have an inventory object that for the draw event, displays an image over everything you see. My question is, why is it that when I move, the inventory lags behind by a pixel or two ( If I start moving right, it follows you but with a gap of two pixels on the right side of the screen or view).