Method to continue moving straight in the previous direction even after releasing the directional keys, as long as another key is pressed

After transitioning to the accel_start state, I want the player to continue moving straight in the current direction even if only the charge&accel keys are held down (i.e., the directional keys have been released).

<What I’m Struggling With>

Currently, after transitioning to the accel_start state, even if the charge&accel keys are held down, releasing the directional keys causes the player object to stop while continuously displaying the 03_boost animation in place.

I tried various approaches while asking ChatGPT, such as suggestions like “assign the variable last_dir as -1/0/1,” but none of them worked, and I’m now at a loss.

chrome-capture-2025-08-20

I tried it locally for a bit.

I’m not sure if this is a bug or intended behavior, but if you press the accelerator key immediately after inputting a movement key, the character moves. However, if you press the accelerator key after a short delay following the movement key input, the character seems to stop. (Is it stopping due to a conflict with the movement key input…?)

I will check with the development team.

1 Like

Thank you for your confirmation.

I just thought of something: Is it possible to implement a process where the movement speed generated by directional key presses up to the “moving” state is carried over even after transitioning to the “accel_start” state, even if the directional key inputs are stopped?

If such a process could be implemented, I wondered if the player node might continue moving in the direction it was previously traveling, even if only the charge & accel keys are being pressed.

I considered whether inertia control could achieve this and looked for relevant options in the link’s “Other Condition Settings” or the state’s “Add Execution Actions,” but I was unable to find anything.

Basically, as a physical process, it is set to decelerate and stop upon contact with surfaces such as the floor.

Regarding such processing, two possibilities come to mind:

  1. Try the “Accelerated Movement” setting in MoveandJumpSettings.
  2. Try changing the GameObject’s body type from Ground to Floating.

That’s about it. It might be best to try these out.

1 Like

By continuing to experiment with the keyword “competitor,” I was able to successfully implement the desired behavior as follows:

  1. Insert one additional state between “moving” and “accel_start.”
  2. In that inserted state, change the properties for the four directions (up, down, left, right), such as up_move_key_index, to “not set.”
  3. Add “move in the display direction” as the fifth execution action in that same state.

Thank you for your advice!

1 Like