Godot Version
4.7.stable
Question
How to avoid flickering between pixel sprites when slowly lerping zoom?
This is what it looks like:
I am lerping the camera’s zoom with this function in a controller:
func cam_tween_zoom(start_zoom: Vector2, end_zoom : Vector2, duration, transition : Tween.TransitionType, easing : Tween.EaseType): # tweens the camera between two positions
var zoom_tween = create_tween()
zoom_tween.tween_property(self, "cam_zoom", end_zoom, duration).from(start_zoom).set_trans(transition).set_ease(easing)
and then setting the zoom value itself with
self.zoom = cinematic_controller.cam_zoom
I noticed that turning off pixel snapping transforms fixes this, but I don’t want to do so to keep the retro pixel art style of my game. Is there any other solution?
I’m aware that it has something to do with having a non-integer zoom level, but as i want to be able to zoom smoothly and to any point i like it’s not viable to limit the zoom level exlusively to integer values.
Lmk if any more info is needed