Discussion in 'Programming' started by Quantum_Compooter, Aug 27, 2018.

  1. I am new to GMS as in I have less than 24 hours with it. I am simply trying to go from an idle animation to a run animation and back. I am using Spine Pro for the sprite animation. Anytime I move my sprite it just freezes. If I understand correctly it is because every "tick" it is restarting my run animation but I do not know how to rectify this. Any help would be greatly appreciated.

    key_right = keyboard_check(ord("D"));
    key_left = keyboard_check(ord("A"));
    mv_dir = key_right - key_left;
    movement = mv_dir * walksp;
    x += movement;
    if(mv_dir != 0){
      image_xscale = mv_dir;
  2. rIKmAN

    rIKmAN Member

    Sep 6, 2016
    Assuming this is a Step Event, you are setting the animation every single frame which results in it being set back to frame 0 every frame and this is why it appears to "freeze" - it's just frame 0 every frame.

    Add a check to see what animation is already playing before you set it, for example you only want to change to the "run" animation if the run animation isn't already playing.
  3. Ok I will give this a try. I appreciate it.
  4. This solved it. For anyone with this issue I used exactly this. I set a variable to skeleton_animation_get() and then if it wasnt set to the animation I wanted I set it.
    rIKmAN likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice