I want to draw a simple 2D line between the origin and a moving player object. I've tried using a separate entity that always looks at the player entity:
class Body(Entity):
def __init__(self, head: Head):
super().__init__(model="line", color=color.orange, scale=0)
self.origin = Vec2(0, 0)
self.head = head
def update(self):
self.look_at_2d(self.head)
self.scale = distance(self, self.head)
But the line is still centered at the origin and has the wrong orientation, the 'surface' is faced to the player, not the tip:
How can I properly adjust the rotation and position of the line?