Skip to content

Conversation

@Falco-Boehnke
Copy link

Added instructions for handling diagonal movement animations and "correcting" animation flips based on player input. This fixes "moving sideways and down causes player to flip back on its feet" animation state.

Added instructions for handling diagonal movement animations and correcting animation flips based on player input. This fixes "moving sideways and down causes player to flip back on its feet" animation state
Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these changes are merged the demo project needs to be adjusted to match as well

.. tabs::
.. code-tab:: gdscript GDScript

if(velocity.x != 0 && velocity.y !=0): # If vertical and horizontal movement keys are pressed
Copy link
Member

@AThousandShips AThousandShips Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(velocity.x != 0 && velocity.y !=0): # If vertical and horizontal movement keys are pressed
if velocity.x != 0 and velocity.y != 0: # If the vertical and horizontal movement keys are pressed.

$AnimatedSprite2D.flip_v = false
# See the note below about the following boolean assignment.
$AnimatedSprite2D.flip_h = velocity.x < 0
elif velocity.y != 0 :
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elif velocity.y != 0 :
elif velocity.y != 0:


.. code-tab:: csharp

if (velocity.X != 0 && velocity.Y != 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (velocity.X != 0 && velocity.Y != 0)
if (velocity.X != 0 && velocity.Y != 0) // If the vertical and horizontal movement keys are pressed.

Play the scene again and check that the animations are correct in each of the
directions.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@AThousandShips AThousandShips added enhancement area:getting started Issues and PRs related to the Getting Started section of the documentation linked demo pr Documentation PRs that are tied to a demo repository PR and removed linked demo pr Documentation PRs that are tied to a demo repository PR labels Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:getting started Issues and PRs related to the Getting Started section of the documentation enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants