Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | TP |
Hi,
I am relatively new to Godot GDScript language.
I would like to move arms, legs, head, etc. of a 2d character (having or not having a skeleton). At runtime, I need to drag each of the above mentioned body parts with mouse and place them in a new pose like a manequin, just as I move them in edit mode. Any hints about how it can be done?
I know how to move, rotate, scale a single sprite with GDScript at runtime with the following code:
ROTATE:
get_node(“.”).look_at(get_global_mouse_position())
SCALE:
if event.get_relative().x > 0:
get_node(“.”).scale += Vector2(0.02, 0.02)
else:
get_node(“.”).scale -= Vector2(0.02, 0.02)
MOVE:
get_node(“.”).position += event.get_relative()
However, I guess it might be a little bit more complex in the case of a 2d character with a head and limbs.
Thank you