Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ali1995 |
Hello guys
I was working on footsteps sound
But I got a problem when I stop, the sound does not stop with the player
Because of the time of the audio effect is long
How can I solve this problem
this my script
if is_on_floor() and not foot.playing and dir.z and dir.x != 0 :
foot. Play()
السلام عليكم
لدي مشكلة واجهتني في خطوات اللاعب
ثدرت أخليه يعمل لما أتحرك لكن أذا وقفت الصوت يكمل لين ما يخلص مقطع الصوت
فكيف أحل هذي المشكلة
did you try ?
if is_on_floor() and not foot.playing and dir.z and dir.x != 0 :
foot. Play()
else:
foot.stop()
or
if dir.z and diz.x == 0:
foot.stop()
ramazan | 2022-09-01 15:30
frist code will not make the sound work at all
Second one
not make any differed
I saw youtuber put timer, but I don’t know if this actually work
or his sound effect repeat because its short voice
ali1995 | 2022-09-01 15:57
I think you should attach function call on the running animation when the frame of hitting the ground should add the call and play the sfx there ,
Should work like that also for dust particle same idea
و بتوفيق
xCode Soul | 2022-09-01 21:58
‘or’ was the answer
oh my god
if dir.z or dir.x !=0:
if is_on_floor():
if ! foot.playing:
foot. Play()
else :
foot. Stop()
"أشتغل لما قلت له "أو
أعتذر للجميع على الأزعاج
ali1995 | 2022-09-02 08:12
Make it answer to help another people
Ghost#1 | 2022-09-03 22:32