How do I restart an animation that keeps stopping using MoveTo?

0 favourites
  • 5 posts
From the Asset Store
In this template the music plays without looping in your game
  • I have code set up that sets animation based on the angle and the movement. However the issue is when there is NO "touch" in place the animation stops.

    I've separated the animation triggers with separate conditions from the "Is in Touch" to play the respective animation and the animation still stops when the sprite "moves" or doesn't work at all.

    One example I did was:

    I delegated the angle of touch to a 1,2,3, or 4 to "AnimationTracker." Then I based it on

    --> If Sprite is Moving

    --> If AnimationTracker = 1 THEN play "animation" and so forth.

    I am confused because not even this works when you separate the touch conditions.

    I am guessing animations don't work with "MoveTo" behaviors?

    Screenshot of Current Code:

    gyazo.com/24b1c0f34c5676dc21a3e8443b0a0233

  • MoveTo behavior doesn't control animations.

    I'm guessing your animations simply play to the end and then stop. You need to set them looping in the animation editor.

    And also add another event - "MoveTo on arrived: Tiger set animation to Idle"

    By the way, all "Else" blocks in your screenshot are empty and have no effect. Also the angle values look wrong to me. You might want to change your code like this:

    Is in Touch (parent event)
    
    ... (sub-events)
    
    ... Angle between 45 and 135 : Move up
    
    ... Else
    ... Angle between 135 and 225 : Move right
    
    ... Else
    ... Angle between 225 and 315 : Move down
    
    ... Else : Move left
    
    
  • The angles work fine for what I need them to do.

    I did in fact check on "loop" in the animations and my issue still stands.

    I am at a loss here because I am convinced the game does not support touch-based animation tracking when it involves moving for both the X and Y axis.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • MoveTo behavior doesn't control animations.

    I don't have any issues using the 8direction behavior and the angles work accordingly with what you suggested when I use 8direction. However I am using touch-based movement and this is where my issues begin.

  • Please share your project file. You can make a small demo project demonstrating the issue if you don't want to share your main one.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)