kBlankii I think the reason it's not working is probably due to the timing of the SpineBone.set_x()
call. In the case of spine-godot, there is a signal called before_world_transforms_change
among the signals emitted by SpineSprite. Calling SpineBone.set_x()
here should work. For example, like this:
extends SpineSprite
var offset_x = 0
var bone
func _ready():
get_animation_state().set_animation("walk", true, 0)
bone = get_skeleton().find_bone("hip")
func _process(_delta):
offset_x += 200 * _delta
func _on_before_world_transforms_change(spine_sprite: Object) -> void:
bone.set_x(offset_x)
Here's what it looks like when you run this (apologies for the strange appearance since it's just a test):
I hope this is helpful.