- Edited
I wonder if there is a code to make a bone on this character's arm rotate dependent on cursor position.
Also, video for context
I wonder if there is a code to make a bone on this character's arm rotate dependent on cursor position.
Also, video for context
it seems simple, you can get your cursor pos related to your character, then get degree from atan(pox.y/pox.x), finally set it as bone degree
Well yeah, it's pretty easy. I add "get_global_mouse_position()" to the upper and bottom arm bones, the result is pretty good, but let's see if it works or not in the future.
extends Bone2D
func _process(delta: float) -> void :
look_at(get_global_mouse_position())
The result