Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

Thank you!


The footsteps are a small sprite that matches the shape of the player's foot.

 


From this, I created a footstep scene that fades opacity of the sprite over 30 seconds and deletes it afterward.


A reference to this scene is stored in the player script.


When the player walks, there's a script that plays a footstep sound on regular intervals (this was timed with the player's feet being fully extended in the sprite sheet (3rd and last frame in the sprite sheet (Although I think we switched the order around in game to make walking feel more natural)).

Since the walk sound already plays at the correct time, I can just instantiate a footstep in the same part of the script. I use an integer to keep track of which foot is stepping (1 for right, -1 for left), and flip the sprite along local y accordingly - there's also a positional offset, so it looks like it's coming the back foot of the current frame.

Hope this helps!


Edit:

The spritesheet above has 7 frames. The one we implemented in Godot actually has 8 frames, so one step always takes 4 frames.


thank you for sharing