mouse position not updating

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By KiRaDomesday

i need to make the players x to be the same as the mouse’ x so i use:
var mouse_x = get_viewpoint_().get_mouse_position ().x
set_position (Vector2(mouse_x, y))
but it doesn’t work
thanks in advance
ps i already have a var for y

Could you tell what happens?

Btw., it’s called get_viewport(). Also you can set most positions by simply assigning the value: self.position = Vector2(mouse_x, y).

Jowan-Spooner | 2019-05-24 09:15