I have my game structured like this:
I have a script in player and I want to draw a line between item and player, the line should update as the player moves (item will be static), like they were tied by a rope.
This is the script in player:
onready var item = getparent().getnode('item')
drawline($player.position, item.globalposition, linecolor, line_width)
The problem is that the line gets drawn from the player (correct) but instead of going to the point where is the item (in this case in point (200, 100)) it gets drawn just 200 pixels to the right and 100 down where the player is.
What should I do???