We introduced TCastleSceneCore.DefaultAnimationTransition property.
This is a really easy way to request animation cross-fading (blending) which makes changing animations look much smoother. Just set this to some non-zero value to have smooth animation change. It’s the time in seconds, often it’s reasonable to start with something small like 0.1.
This is also configurable in the CGE editor (as it’s a published property). Our “New Project” template 2d_game is using it.
<model url="knight.gltf" pool="10" default_animation_transition="0.25"> <idle animation_name="Idle" /> <walk animation_name="Walk" /> <attack animation_name="Attack" /> <die animation_name="Die" /> <hurt animation_name="Damaged" /> </model>
This also brings improved switching to the default state (like idle or walk) after Attack/Hurt. This makes animation change smoother for creatures using
resource.xml, whether you use
default_animation_transition or not.