how to change position of kinematic body 2d with coordinates

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Ideamama

I just started learning Godot and am trying to make a Flappy Bird clone. I have fixed the position of the bird and background and I want the pipes to move . After a pipe has moved from right to left, it want it to come back to its position a bit more than the extreme right.
My pipe is a kinematic body 2d. How do I do this?
It would be great if someone could help me.
Thanks in advance!

:bust_in_silhouette: Reply From: jgodfrey

Are you asking how to move the pipe to the new position or how to determine what the position should be?

To move it, just set the pipe’s position property to the new location.

If you’re asking about the position itself, there are lots of ways to calculate an appropriate “offscreen” position. For example, you could simply manually find the right X-position in the editor and always move it there “in_game”. Or, you could move it to screen_width + 1/2 your pipe width + a small buffer. Or, you could …

It really depends on what you want / need.