The 2nd arg in interpolate_property
takes a NodePath
, but str of a path to a prop seems fine too. So I'd expect this to work:
var rotation_node_path = "/root/Main/Boid1/InitialRegion/Bird:rotation"
but I'm getting the error
ERROR: interpolate_property: Condition ' !prop_valid ' is true. returned: false
func lerp_rotation():
add_child(tween)
var rotation_node_path = str(parent.get_path()) + ":rotation"
var current = Math.smallest_equal_angle(parent.rotation)
var target = Math.smallest_equal_angle(target_rotation)
var duration = 1
print(current, ' ', target, ' ', rotation_node_path)
tween.interpolate_property(parent, rotation_node_path, current, target, 1, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
tween.start()
Math.smallest_equal_angle
? I can't find that in the godot docs. What type of object are you running this in? \$\endgroup\$parent
? Are we talking about 2D or 3D? \$\endgroup\$