+2 votes

I'm trying to create procedural animations using Bone2D nodes.
My character's arms and legs use Inverse Kinematics and it works fine in editor.
For example : I want the hand of my character to touch a point.

For this, I wanted to simply set the hand's position in my script

func _process(delta):
   hand.position = $"/root/Scene/Position2D".global_position

I thought it would move the hand and solve IK as it does in editor but it doesn't, because the position property of a Bone2D isn't modified when moving it in the editor. I've searched the docs to find a way to do this but I found nothing.

I thought then about writing a script to solve 2-bone IK which is not that hard. But another problem comes in : there is no way of knowing the actual position of a Bone2D in script, nor the position of the tip of the bone.

I really don't know what to do now.

in Engine by (14 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.