S
Sergei
Guest
Good day!
I'm using the latest version of GameMaker Studio 2 and the latest version (not Beta) of Spine. I created a character with several animations: standing, coming, swinging, hitting and returning. For the standing and walking animations, I have key points for all the bones (well, maybe I did not set Root for the bone). In general, I try to set key points only for those bones that I need to somehow control. For swing, hit and return animations, I set key frames for only two bones of the hand, since I do not want to influence anything else here. So I can attack in motion. Animations of standing and motion are cyclical, so here I do nothing. But other animations should not be played back cyclically, so I hang events on them. They look like this: AttackSwing, AttackHit, and AttackReturn.
Actually it all starts with the fact that I force the character to stand:
All this is reproduced on track 0. When I press 1 (I'm checking for the moment of the first press, and not on hold), I want the character to hit with his right hand. On track 2, I set the animation:
Everything is working fine here. However, the animation is circulating. For this, I start processing the Animation Event:
My idea is correct. Indeed, there is a swing, kick, return and then a standard animation of standing. I have not done the smooth transition yet. Faced artifacts. Watch the video:
Where do these artifacts come from? How to fix it?
I'm using the latest version of GameMaker Studio 2 and the latest version (not Beta) of Spine. I created a character with several animations: standing, coming, swinging, hitting and returning. For the standing and walking animations, I have key points for all the bones (well, maybe I did not set Root for the bone). In general, I try to set key points only for those bones that I need to somehow control. For swing, hit and return animations, I set key frames for only two bones of the hand, since I do not want to influence anything else here. So I can attack in motion. Animations of standing and motion are cyclical, so here I do nothing. But other animations should not be played back cyclically, so I hang events on them. They look like this: AttackSwing, AttackHit, and AttackReturn.
Actually it all starts with the fact that I force the character to stand:
Code:
skeleton_animation_set("Stay");
Code:
if(keyboard_check_pressed(ord("1")))
{
skeleton_animation_set_ext("AttackChopSwingRight",2);
}
Code:
var eventName=event_data[?"name"];
var eventTrack=event_data[?"track"];
var eventInteger=event_data[?"integer"];
var eventFloat=event_data[?"float"];
var eventString=event_data[?"string"];
var trackLeft=1;
var trackRight=2;
var trackBoth=3;
if(eventTrack==trackRight)
{
if(eventName=="AttackSwing")
{
skeleton_animation_set_ext("AttackChopHitRight",trackRight);
}
else if(eventName=="AttackHit")
{
skeleton_animation_set_ext("AttackChopReturnRight",trackRight);
}
else if(eventName=="AttackReturn")
{
skeleton_animation_clear(trackRight);
}
}