setting new animation resets horizontal speed?

This forum is currently in read-only mode.
From the Asset Store
a full game example, menu system, with the first level and a boss, to create a horizontal shooter
  • It seems to me that setting a new animation sets a sprite's [Platform].VectorX back to 0. I'm not 100% positive that this is what's happening, but I can see no other explanation for what I'm seeing, and I'm looking for a confirmation and/or an alternate method to accomplish my goal.

    I have a sprite that starts at a speed of 10 (or -10, depending on whether he's facing left or right) and gradually accelerates until he either collides with a wall, or collides with the player. This resets his speed back to 0, and he begins to accelerate again towards the player. Think of any generic charging-bull type boss in a sidescroller.

    What I'm trying to do is change his animation to something else once he reaches a particular speed (let's call it 250 for sake of ease). Every time he reaches this speed, he pauses briefly, and then starts over again from speed 10. It seems to me that the act of setting a new animation is causing his speed to drop back to 0, which resets his animation to the "moving slowly" animation.

    Just to get it out of the way before any questions come up, before I started playing with animations his movement was exactly the way I wanted it; the only thing I've changed since is adding statements saying essentially (if AnimName="blah" and speed<blah then set animation "otherblah").

    So... any ideas?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It would help a lot if you included an example cap of the problem at hand. Without it people trying to help would have to recreate the situation themselves. And then maybe due to different approaches / events they wouldn't even run into the same problem. If you shared a cap, I would be happy to look into it.

    Also: which version of Construct are you using?

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