This is my first 2d platform game I am trying to complete. I am using multiple Physics platform movements to create a sort of "sprint" button/key by holding down the space bar. When I hold the space bar down, my character's movement changes to a movement with a faster speed value. When I release the space bar, the movement is changed back to the default movement which has a reduced movement speed. Right now, I have it working as far as the speed increase/decrease goes.
The issue that I am having is with character direction, when I am facing to the right, everything works perfectly with no issue. When my character is facing or running to the left, and then hit the space bar, his direction changes to facing to the right. This causes some weird visual abnormalities when pressing/releasing the space bar when running left or while stopped. It only happens initially when the movement changes when running to the left, the character eventually changes from right to left which causes a sort of hiccup in the animation which isn't smooth. When stopped and facing left, the character changes his direction to the right and stays that way until I change directions.
So far, I have tried to brain storm and search the forums to find a solution with no luck. I have tried everything from trying to set the direction in the event editor while pressing space bar and facing left etc with no success. At best I can get the character to face permanently to the left which doesn't solve the issue, just creates a new one. Setting the initial direction on the different movements appears to have no effect at all. To try and isolate the issue, I broke everything down to the basics, one character with a ground back drop, a minimal number of events, the issue still happens. Setting the "maximum speed" is not possible with the Physics Platform movement, it is greyed out, I would like to avoid changing it to 8 direction movements or similar as a work around.
Here is a break down of my event editor that I configured for this "sprint" key.
1) Repeat while "Space bar" is pressed --- Set Alterable value A to 1 for the character
2) Negate repeat while "Space bar" is pressed --- Set Alterable value A to 0 for the character
3) Alterable Value A of "Character" = 1 --- Select movement number 3 (Character running movement)
Only one action when event loops
4) Alterable Value A of "Character" = 0 --- Select movement number 1 (Character walking movement)
Only one action when event loops
Any help would be much appreciated. This really feels like working around a bug or limitation with the type of movement I am using, hopefully I am wrong though and there is a way to overcome this issue.



Reply With Quote










