FlameRooster
Member
Edit: Nevermind, it is working now.
This is code to make a character blink in Spine.
The Idle animation uses the "Eyes 1" attachment, and the Run animation uses the "Eyes 4" attachment.
The blinking code below works for the "Eyes 1" attachment, but doesn't work for the "Eyes 4" attachment.
When my character is on the Run animation for example with the "Eyes 4" attachment on, then the Eyes slot never gets set to "Eyes 2". It keeps looping the alarm[0] every 10-20 frames. I am guessing this is a bug, but I want to make sure if anyone knows how to fix this before reporting.
Can I get any help with this?
[Slot] - Eyes
[Attachment] - Eyes 1 - (Idle eyes)
[Attachment] - Eyes 2 - (Blink eyes)
[Attachment] - Eyes 4 - (Run eyes)
Create Event
Alarm 0 Event
This is code to make a character blink in Spine.
The Idle animation uses the "Eyes 1" attachment, and the Run animation uses the "Eyes 4" attachment.
The blinking code below works for the "Eyes 1" attachment, but doesn't work for the "Eyes 4" attachment.
When my character is on the Run animation for example with the "Eyes 4" attachment on, then the Eyes slot never gets set to "Eyes 2". It keeps looping the alarm[0] every 10-20 frames. I am guessing this is a bug, but I want to make sure if anyone knows how to fix this before reporting.
Can I get any help with this?
[Slot] - Eyes
[Attachment] - Eyes 1 - (Idle eyes)
[Attachment] - Eyes 2 - (Blink eyes)
[Attachment] - Eyes 4 - (Run eyes)
Create Event
Code:
skeleton_animation_set("Idle");
//Sets eyes to "Eyes 1"
eyes = skeleton_attachment_get("Eyes");
alarm[0] = 5;
Alarm 0 Event
Code:
if (skeleton_attachment_get("Eyes") != "Eyes 2") {
//Makes the character blink
skeleton_attachment_set("Eyes", "Eyes 2");
alarm[0] = irandom_range(10, 20);
} else {
//Sets the Eyes slot back to the eyes used by Idle, or Run
if (skeleton_animation_get() == "Idle") {
eyes = "Eyes 1";
} else if (skeleton_animation_get() == "Run") {
eyes = "Eyes 4";
}
skeleton_attachment_set("Eyes", eyes);
alarm[0] = irandom_range(250, 260);
}
Last edited: