godot-4
Hey everyone, I’m new here, just starting using Godot (absolutely love it).
I’m making a mobile tycoon game. The main game area is a long horizontal rectangle divided into screens I’m making the camera snap to. I wrote a simple script to detect horizontal swipes and move to the next screen accordingly by simply changing the position.x attribute of the Camera2D node. The script itself works perfectly. I’m of course using position smoothing to not make it look horrible.
The problem arises when I attach UI to the Camera2D node as a child. With position smoothing on the UI “teleports” to the final position, while the camera lags behind due to the smoothing. I’d like for the UI to stay glued to the screen during motion. Should I not use Camera2D as a parent for the UI?
I’m assuming this is due to position smoothing not being “real” movement as far as the engine is concerned. Is there an easy way to get what I want or should I just rewrite the code making the camera actually move instead of just jumping to position.x and then smoothing it?