Skip to main content
added 4 characters in body
Source Link
Theraot
  • 28.3k
  • 4
  • 55
  • 83

One of the "tricks" I mentioned in another answer was using an AnimationPlayer to play animation from another AnimationPlayer using an "Animation PlayPlayback Track". Doing that the imported AnimationPlayer can be untouched in Godot (and thus you do not lose work if you have to import it again), and the other AnimationPlayer can have additional tracks such as "Call Method Track" to enable/disable colliders.

Or you could split the animations, so you have Windup (a.k.a anticipation), Strike, and Recovery. Then instead of enabling/disabling colliders, when there is a collision you can check which is the current animation. Which you could queue in the AnimationPlayer, or chain with an AnimationTree. I suggested a similar approach in yet another answer.

OK, let us say you don't want to split the animation either... Then what? You could check the current position within the animation by reading current_animation_position of the AnimatinPlayer. I'd expect a small timing error given that the animation usually runs on graphic frames and physics on physic frames, but it should not be a big issue. You would have to code the time intervals for each animation, so you can compensate for any timing problem there.

Or you could take control of the playback by setting the playback_process_mode to "manual" (ANIMATION_PROCESS_MANUAL) then using seek and advance, in which case you are in control of the animation timing and there would be no timing error.


Addendum You might do the attack animations in Godot. I'm aware that Godot 3 does not let you manipulate bones directly (as Godot 4 does), but Godot 3 has an IK solution (SkeletonIK) and you can key frame the target of the SkeletonIK in an Animationplayer, so you don't need to do round trips to Blender. It is even possible to do it all programmatically, even skipping SkeletonIK, but that is more work.

One of the "tricks" I mentioned in another answer was using an AnimationPlayer to play animation from another AnimationPlayer using an "Animation Play Track". Doing that the imported AnimationPlayer can be untouched in Godot (and thus you do not lose work if you have to import it again), and the other AnimationPlayer can have additional tracks such as "Call Method Track" to enable/disable colliders.

Or you could split the animations, so you have Windup (a.k.a anticipation), Strike, and Recovery. Then instead of enabling/disabling colliders, when there is a collision you can check which is the current animation. Which you could queue in the AnimationPlayer, or chain with an AnimationTree. I suggested a similar approach in yet another answer.

OK, let us say you don't want to split the animation either... Then what? You could check the current position within the animation by reading current_animation_position of the AnimatinPlayer. I'd expect a small timing error given that the animation usually runs on graphic frames and physics on physic frames, but it should not be a big issue. You would have to code the time intervals for each animation, so you can compensate for any timing problem there.

Or you could take control of the playback by setting the playback_process_mode to "manual" (ANIMATION_PROCESS_MANUAL) then using seek and advance, in which case you are in control of the animation timing and there would be no timing error.


Addendum You might do the attack animations in Godot. I'm aware that Godot 3 does not let you manipulate bones directly (as Godot 4 does), but Godot 3 has an IK solution (SkeletonIK) and you can key frame the target of the SkeletonIK in an Animationplayer, so you don't need to do round trips to Blender. It is even possible to do it all programmatically, even skipping SkeletonIK, but that is more work.

One of the "tricks" I mentioned in another answer was using an AnimationPlayer to play animation from another AnimationPlayer using an "Animation Playback Track". Doing that the imported AnimationPlayer can be untouched in Godot (and thus you do not lose work if you have to import it again), and the other AnimationPlayer can have additional tracks such as "Call Method Track" to enable/disable colliders.

Or you could split the animations, so you have Windup (a.k.a anticipation), Strike, and Recovery. Then instead of enabling/disabling colliders, when there is a collision you can check which is the current animation. Which you could queue in the AnimationPlayer, or chain with an AnimationTree. I suggested a similar approach in yet another answer.

OK, let us say you don't want to split the animation either... Then what? You could check the current position within the animation by reading current_animation_position of the AnimatinPlayer. I'd expect a small timing error given that the animation usually runs on graphic frames and physics on physic frames, but it should not be a big issue. You would have to code the time intervals for each animation, so you can compensate for any timing problem there.

Or you could take control of the playback by setting the playback_process_mode to "manual" (ANIMATION_PROCESS_MANUAL) then using seek and advance, in which case you are in control of the animation timing and there would be no timing error.


Addendum You might do the attack animations in Godot. I'm aware that Godot 3 does not let you manipulate bones directly (as Godot 4 does), but Godot 3 has an IK solution (SkeletonIK) and you can key frame the target of the SkeletonIK in an Animationplayer, so you don't need to do round trips to Blender. It is even possible to do it all programmatically, even skipping SkeletonIK, but that is more work.

added 429 characters in body
Source Link
Theraot
  • 28.3k
  • 4
  • 55
  • 83

One of the "tricks" I mentioned in another answer was using an AnimationPlayer to play animation from another AnimationPlayer using an "Animation Play Track". Doing that the imported AnimationPlayer can be untouched in Godot (and thus you do not lose work if you have to import it again), and the other AnimationPlayer can have additional tracks such as "Call Method Track" to enable/disable colliders.

Or you could split the animations, so you have Windup (a.k.a anticipation), Strike, and Recovery. Then instead of enabling/disabling colliders, when there is a collision you can check which is the current animation. Which you could queue in the AnimationPlayer, or chain with an AnimationTree. I suggested a similar approach in yet another answer.

OK, let us say you don't want to split the animation either... Then what? You could check the current position within the animation by reading current_animation_position of the AnimatinPlayer. I'd expect a small timing error given that the animation usually runs on graphic frames and physics on physic frames, but it should not be a big issue. You would have to code the time intervals for each animation, so you can compensate for any timing problem there.

Or you could take control of the playback by setting the playback_process_mode to "manual" (ANIMATION_PROCESS_MANUAL) then using seek and advance, in which case you are in control of the animation timing and there would be no timing error.


Addendum You might do the attack animations in Godot. I'm aware that Godot 3 does not let you manipulate bones directly (as Godot 4 does), but Godot 3 has an IK solution (SkeletonIK) and you can key frame the target of the SkeletonIK in an Animationplayer, so you don't need to do round trips to Blender. It is even possible to do it all programmatically, even skipping SkeletonIK, but that is more work.

One of the "tricks" I mentioned in another answer was using an AnimationPlayer to play animation from another AnimationPlayer using an "Animation Play Track". Doing that the imported AnimationPlayer can be untouched in Godot (and thus you do not lose work if you have to import it again), and the other AnimationPlayer can have additional tracks such as "Call Method Track" to enable/disable colliders.

Or you could split the animations, so you have Windup (a.k.a anticipation), Strike, and Recovery. Then instead of enabling/disabling colliders, when there is a collision you can check which is the current animation. Which you could queue in the AnimationPlayer, or chain with an AnimationTree. I suggested a similar approach in yet another answer.

OK, let us say you don't want to split the animation either... Then what? You could check the current position within the animation by reading current_animation_position of the AnimatinPlayer. I'd expect a small timing error given that the animation usually runs on graphic frames and physics on physic frames, but it should not be a big issue. You would have to code the time intervals for each animation, so you can compensate for any timing problem there.

Or you could take control of the playback by setting the playback_process_mode to "manual" (ANIMATION_PROCESS_MANUAL) then using seek and advance, in which case you are in control of the animation timing and there would be no timing error.

One of the "tricks" I mentioned in another answer was using an AnimationPlayer to play animation from another AnimationPlayer using an "Animation Play Track". Doing that the imported AnimationPlayer can be untouched in Godot (and thus you do not lose work if you have to import it again), and the other AnimationPlayer can have additional tracks such as "Call Method Track" to enable/disable colliders.

Or you could split the animations, so you have Windup (a.k.a anticipation), Strike, and Recovery. Then instead of enabling/disabling colliders, when there is a collision you can check which is the current animation. Which you could queue in the AnimationPlayer, or chain with an AnimationTree. I suggested a similar approach in yet another answer.

OK, let us say you don't want to split the animation either... Then what? You could check the current position within the animation by reading current_animation_position of the AnimatinPlayer. I'd expect a small timing error given that the animation usually runs on graphic frames and physics on physic frames, but it should not be a big issue. You would have to code the time intervals for each animation, so you can compensate for any timing problem there.

Or you could take control of the playback by setting the playback_process_mode to "manual" (ANIMATION_PROCESS_MANUAL) then using seek and advance, in which case you are in control of the animation timing and there would be no timing error.


Addendum You might do the attack animations in Godot. I'm aware that Godot 3 does not let you manipulate bones directly (as Godot 4 does), but Godot 3 has an IK solution (SkeletonIK) and you can key frame the target of the SkeletonIK in an Animationplayer, so you don't need to do round trips to Blender. It is even possible to do it all programmatically, even skipping SkeletonIK, but that is more work.

Source Link
Theraot
  • 28.3k
  • 4
  • 55
  • 83

One of the "tricks" I mentioned in another answer was using an AnimationPlayer to play animation from another AnimationPlayer using an "Animation Play Track". Doing that the imported AnimationPlayer can be untouched in Godot (and thus you do not lose work if you have to import it again), and the other AnimationPlayer can have additional tracks such as "Call Method Track" to enable/disable colliders.

Or you could split the animations, so you have Windup (a.k.a anticipation), Strike, and Recovery. Then instead of enabling/disabling colliders, when there is a collision you can check which is the current animation. Which you could queue in the AnimationPlayer, or chain with an AnimationTree. I suggested a similar approach in yet another answer.

OK, let us say you don't want to split the animation either... Then what? You could check the current position within the animation by reading current_animation_position of the AnimatinPlayer. I'd expect a small timing error given that the animation usually runs on graphic frames and physics on physic frames, but it should not be a big issue. You would have to code the time intervals for each animation, so you can compensate for any timing problem there.

Or you could take control of the playback by setting the playback_process_mode to "manual" (ANIMATION_PROCESS_MANUAL) then using seek and advance, in which case you are in control of the animation timing and there would be no timing error.