Hey guys, I've been stuck on something for over a day now. I have a UI canvas layer that follows the camera, and another object in the game (on its own canvas layer). It's basically a ux layer, and a layer containing game objects, including cards. I want a ux element to follow the card on the screen.
I've got it mostly working, but for some reason when the camera's zoom isn't 1, the ux element becomes offset from the card, depending on the zoom amount?! I'm very lost and have tried a lot of stuff. Has anyone come across this before? Does somebody that knows more know what's up? This is the process code attached to a "cardFollower" node (its position is meant to follow the position of the card):
+ get_viewport_rect().size/2 \
- (cam.get_screen_center_position() * cam.zoom.x)```