• 2D
  • draw_line coordinates

I'm using a couple of sprites a distance apart to follow a 2d path

i'm taking each Sprite's global_position and using the values to draw_line(from,to, col)

I want to draw a simple a line from one Sprite to the other

trouble is, the line being drawn is not in the correct location. As each spirite traverses the path, the line should consistently connect tbe two sprites. Instead the line being drawn seems to follow a smaller facsimile of the path, closer to the screen origin 0,0

am I right in thinking the sprites' global_position can be used in draw_line() ?

It's better to always work in local positions. But, either way, you'll have to do some math depending on the hierarchy and where exactly you are drawing to.

thanks for the input. Like I say, it's working, but to the extent that the line is following a path a fraction of the size and closer to the upper left of the screen?