Author Topic: Simple Footstep Sounds Tutorial  (Read 57 times)

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 21: Magmus
  • *
  • Posts: 1897
  • Total likes: 148
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Simple Footstep Sounds Tutorial
« 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.
« Last Edit: December 24, 2020, 12:02:52 PM by Antikore »
Sorry because my English is not very good because I'm Spanish ;) :P