Platform Builder Forums
Help and Support => Tutorials => Topic started by: Antikore on December 24, 2020, 11:26:49 AM
-
I made this, just insert them on the corresponding CPs in your game:
//Create CP - Player Character
local var footstepBuffer = 0
//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.
-
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?
-
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