SOLVED How do I loop through part of a Spine skeleton animation?

K

Kuroiryu

Guest
SOLUTION
------------
As usual, writing my question on a forum helped me solve it. All I needed to do was set the unit's animation again before setting its new frame.

if name == "Loop" {
skeleton_animation_set("AnimName")
skeleton_animation_set_frame(0,10)
}


------------
I have skeleton animations imported from Spine and I'm trying to get it to loop through a part of an animation. I have event triggers set up in the Animation Event event_map and they are being detected just fine, I just cant get the animation to do what I want when they trigger.

Here's the jist of what I've tried:

In the Animation Event:
GML:
var name = event_data[? "name"]
var integer = event_data[? "integer"]

if name == "Loop" {skeleton_animation_set_frame(0,10)}
//or
if name == "Loop" {image_index = 10}
//or
if name == "Loop" and integer == 1 {image_speed = 1}
if name == "Loop" and integer == 2 {image_speed = -1}
I would expect one of these to simply rewind or reverse the animation and all its event triggers but they just dont.

skeleton_animation_set_frame(0,10)
I've confirmed that this changes the image_number but it has no effect on the actual animation. I just keeps playing and triggering events, but using the new image_number as if it was that way all along.

image_index = 10
This has the same effect as setting the skeleton animation frame.

image_speed = -1
This seems to simply trigger my End event, skipping past any remaining frames, let alone returning to previous frames.
 
Last edited by a moderator:
Top