Platform Builder Forums

Help and Support => Tutorials => Topic started by: Antikore on December 24, 2020, 11:26:49 AM

Title: Simple Footstep Sounds Tutorial
Post by: Antikore on December 24, 2020, 11:26:49 AM
I made this, just insert them on the corresponding CPs in your game:
Code: [Select]
//Create CP - Player Character
local var footstepBuffer = 0
Code: [Select]
//Looping CP - Player Character
if walking = true | running = true
     footstepBuffer + 1
else
     footstepBuffer = 0
if footstepBuffer < 20 & walking = true
     exit
if footstepBuffer < 10 & running = true
     exit
if walking = false & running = false
     exit
footstepBuffer = 0
upload sfx = 2 //Replace this with your sound id
Hope this helps :D

Note: Remember that exit command kills the cp process so you may put the code for the looping cp at the end of the cp or some code may not execute.
Title: Re: Simple Footstep Sounds Tutorial
Post by: NinthNei on July 22, 2021, 03:06:16 PM
Thank you for making this, just tried it and it works great!

Would it be at all possible to make a different sound that plays after and then loops like the first one?

For instance, your sequence would be Footstep 1 sound for the right foot and then you could have a Footstep 2 sound for the left foot and then repeat the whole sequence from the beginning?
Title: Re: Simple Footstep Sounds Tutorial
Post by: Antikore on July 23, 2021, 06:57:43 AM
Thank you for making this, just tried it and it works great!

Would it be at all possible to make a different sound that plays after and then loops like the first one?

For instance, your sequence would be Footstep 1 sound for the right foot and then you could have a Footstep 2 sound for the left foot and then repeat the whole sequence from the beginning?
Yeah technically is possible