#Weird desync between actual mouse position and what's being passed through Godot?

2 messages · Page 1 of 1 (latest)

queen oxide
#

Hey, I'm making a game where the player continually aims at the mouse. However, it looks like the mouse position isn't being accurately reported. The golden line in the attached footage is drawn with the function:

func _draw():
    draw_line(position, get_global_mouse_position(), Color.GOLD)

with position being a node at the center of the character. What's going on?

shell osprey
#

All the coordinates in the _draw function are interpreted as local to the node you are drawing on