0 votes

When I call getviewportposition() I expect to get the position of the node in the viewport. That happens when the smoothing camera is off, but when it's on I get the final position of the node.

Normally this is not important, but I have a node2d that's drawing (_draw()) directly to the screen position (like a viewport size texture that needs to know exactly where the different elements in the screen are).

So, is there any way to get the real position of the sprites when the screen is moving smoothly or the only way is to set smoothing off and code my own camera 2D smoothing code?

asked Apr 23 in Engine by navi2000 (33 points)

2 Answers

0 votes
Best answer

Sorry for the delay: the only way to acomplish the task was using the get_camera_screen_center() function.

answered Jun 8 by navi2000 (33 points)
0 votes

Use get_camera_position() on the active camera.

answered Jun 8 by technistguru (14 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.