You didn't say what was wrong. I notice that position
is spelled wrong in get_mouse_position()
. Also, are you using Godot 3.0? If so, then this code won't work because there is no longer a set_pos()
function, but instead you use the position
property of the object.
If neither of these are the problem, please comment with more information (especially if you have an error message).
Note: I edited your post to fix the code formatting. Please use the code formatting button when posting code so that it is readable.