Switching IK pose smoothly

Godot Version

4.7

Question

In my model I have both FABRIK and IKSpline. I switch between them by tweening its influence:

	### SWITCHING IK
	tween.tween_property(spline_ik, "influence", 0.0, 0.5)
	tween.tween_property(fabrik_ik, "influence", 1.0, 0.5)

In FABRIK I shaped the tail to a pose by using joint limitations and use target node to aim at player.
In SPLINE I have spline in different shapes and set them using animation player

The problem is when switching it sets to default “straight” pose first then going in to my set pose.

Is it possible to blend the poses between IKs and avoid going to default pose first?

Is that tween parallel?

No it’s all stacked one after another.
*I tried parallel() also didn’t work.

If you manually set both influences to 0.5 does the same happen?

Well it kinda has to be parallel, or it defeats the purpose. you have to make sure the chain is 100% influenced by any ik at all times.

Let’s see the complete tween code in both cases and differences in results.

Here’s the code with parallel:

func _attack_3():
	
	ik_target = player
	
	if tween:
		tween.kill()
	tween = get_tree().create_tween()
	
	### SOME PAUSE
	tween.tween_interval(0.5)
	#tween.tween_interval(0.2)
	#tween.parallel().tween_callback(animPlayer.play.bind("tail_attack", 0.2))

	### SWITCHING IK
	tween.tween_property(spline_ik, "influence", 0.0, 0.5)
	tween.parallel().tween_property(fabrik_ik, "influence", 1.0, 0.5)
	tween.tween_callback(func(): spline_ik.active = false)
	tween.tween_callback(func(): fabrik_ik.active = true)
	
	tween.tween_interval(5.0)
	### SHOOTING ATTACK TO BE HERE
	
	### SWITCHING IK
	tween.tween_property(spline_ik, "influence", 1.0, 0.5)
	tween.parallel().tween_property(fabrik_ik, "influence", 0.0, 0.5)
	tween.tween_callback(func(): spline_ik.active = true)
	tween.tween_callback(func(): fabrik_ik.active = false)
	
	### CYCLE TO NEXT ATTACK
	tween.tween_callback(self._cycle_attack)

The video result is the same with no parallel()

Why not just activate them both and crossfade them?

-Yes still happens if both influences are 0.5.
-I believe the chain is influenced by one of IKs at all times.

-I tried set the blend to zero and it still shows a straight pose for a split second (so instead of blending it looks like a glitch).

tween.tween_property(spline_ik, "influence", 0.0, 0.0)
tween.tween_property(fabrik_ik, "influence", 1.0, 0.0)

That’s not a crossfade tween.

How to crossfade them? I thought tweening both influences in opposite direction results in similar crossfade effect.

Yes but your time is 0.0 and we don’t see if the tween is set to parallel. You also don’t set initial values. Post the entire crossfade tween code.

Oh that 0.0 was for a quick test when replying to anishex. I posted parallel() code with visual from my reply to you.

Yes but you didn’t post parallel crossfade code.

	tween.tween_property(spline_ik, "influence", 0.0, 0.5)
	tween.parallel().tween_property(fabrik_ik, "influence", 1.0, 0.5)

I thought this was the parallel “crossfade” code. If not, how?

Make sure you set the initial values as well.