![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | ShatteredDream |
How do I make my static body 2d’ position equal to the mouse position through gdscript?
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | ShatteredDream |
How do I make my static body 2d’ position equal to the mouse position through gdscript?
![]() |
Reply From: | Gluon |
You should be able to use the following lines of code to achieve that.
var mouse_pos = get_global_mouse_position()
$StaticBodyName.position = mouse_pos
but a static body shouldnt be moved around really. You should have a different node for that really