I'm looking for a way to simulate both the "on stopped" and "on moved" triggers in the Platform Behavior, but use them in the 8-Way movement.
Right now I'm simulating the "on stopped" looking for the condition:
Player -> 8 Direction Speed < 100
I combine that with different "when a specific animation is playing" for each direction to pick the correct animation.
The problem is that the animation is slightly triggered when I start moving. It strangely works so far because the frames kind of work, but that's more of a happy accident. Any help is appreciated.
This is what it sounds like is happening, correct me if I'm wrong:
Any time the speed is below 100 *and* a moving animation is playing, the game begins to play the stop animation. So when you slow to a stop you're fine because you go below 100 speed and play the stopped animation once. But if you start moving again the game will try to play the moving animation again when the object is still under 100 speed! This causes the event to trigger again, playing the "stopped" animation from the beginning.
I can't really give you a precise solution because I don't know how you have your animations set up, but if my assessment is correct the solution is to make sure your moving animations don't fire unless the object's speed is greater/equal to 100.
Also, if you use a free file hosting service like drop box to host a single file capx of your project it makes helping you a lot easier. Screenshots are less ideal but can work too. Without either it will be hard for me to help you further if my idea doesn't work.
Here is the link to the Capx file.
To see what I'm talking about, hit F to fly and move left or right with the arrow keys.
Develop games in your browser. Powerful, performant & highly capable.
I'm starting to think now that maybe instead of triggering it by the speed of the character, maybe I should be triggering it by the release of a button. I know that letting go of the right or left key will stop the movement. I could set it up then. I will test that theory later.
Yeah my assessment is correct. If you set the stopping condition to be less than 400 speed the first frame of "leftstop" plays the whole time. This is because holding the button causes "left" to play but then later in the event list the stopping event checks for "left", sees "left" and causes "leftstop" to play instead, doing this within every single tick, leaving you stuck on frame 1 of "leftstop" until you release the button or exceed the speed set in the stop event. The stop animation works if you let go of the button because the game stops trying to play the "left" animation.
Playing leftstop on key release is actually a great idea. It should solve your problem since it will make it impossible for the game to try to play both animations at the same time.
I've used this before and it works well.
On keyboard *NOT* pressed Left Arrow
On keyboard *NOT* pressed Right Arrow
On keyboard *NOT* pressed Up Arrow
On keyboard *NOT* pressed Down Arrow
-> Play Idle animation
Just tried the "on button released" method and it worked great. Going to try and implement a starting version later.