Godot Version
4.3
Question
Hey all, I am running into an issue when I try to tween from one transform to a rotated version of the same transform.
For some context, I’m trying to make it so when the player character hits a part of an enemy, the part that was hit rotates the bone thus rotating the connecting mesh.
All I am really doing is taking the pose of the bone and rotating it by 45 degree.
rest_pose = mesh.skin.get_bind_pose(bind_index);
wiggle_pose = rest_pose.rotated(Vector3.UP, deg_to_rad(45));
Then I just tween from one pose to the other.
current_pose = rest_pose;
tween = create_tween();
tween.tween_property(self, "current_pose", wiggle_pose, 1).set_trans(Tween.TRANS_LINEAR).set_ease(Tween.EASE_IN);
Lastly to animate it I set the bind pose to the current pose.
mesh.skin.set_bind_pose(bind_index, current_pose);
The problem is when I run the game, the mesh seems to offset itself despite just rotating it.
So my questions is why does this happen and is there anything I can do to fix it? It is strange too because I have been able to get this to work on other parts of the model.
My best guess is that it has something to do with the bone on the skeleton being at a 45 degree angle but otherwise I am pretty stumped. Thanks for any help, I really appreciate it!