Movement sound adjustments & movement pitch modulation system

This commit is contained in:
Anuken
2025-12-13 02:08:29 -05:00
parent 739ac72af5
commit 209352d3ed
10 changed files with 45 additions and 9 deletions

View File

@@ -707,8 +707,13 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
kill();
}
if(!headless && type.loopSound != Sounds.none){
if(!headless){
control.sound.loop(type.loopSound, this, type.loopSoundVolume);
if(type.moveSound != Sounds.none){
float progress = Mathf.clamp(vel.len() / type.speed);
float pitch = Mathf.lerp(type.moveSoundPitchMin, type.moveSoundPitchMax, progress);
control.sound.loop(type.moveSound, this, type.moveSoundVolume * progress, pitch);
}
}
//check if environment is unsupported