Step sound randomly plays and stops in running animation

So basically i made a Running animation and for every time the character steps both feet down in the animation, i added Markers called “Step” to them. So then in the Animate script i added these lines of code.

		local function onWalkOrRunPlayed()
				print("step")
				Footstep:Play()
			end
			
			if runAnimTrack.IsPlaying == true then
				runAnimTrack:GetMarkerReachedSignal("Step"):Connect(onWalkOrRunPlayed)
			end
			

Starting at line 487 of the Animate script. Now for some reason, when i start walking, the sound starts playing, and then stops, etc. at random times. Here’s a video showing the issue.

2 Likes

so, if you play the same sound over and over, eventually it will not play because of the cap of sounds that can be playing at once.

2 Likes

Then how would i go about fixing this issue?

1 Like

i have an idea but i think is bad:
recreate the animation or change the hip height like 0.1

i hope it helps :grin:

1 Like

and last thing good game! even if is mario 64 in roblox

VERY COOL :grinning:

1 Like

Sadly that didn’t change anything.

1 Like

wait i have an idea:

  1. use an template sound that starts right away (to check if is playng the sound very fast

  2. i think that is the problem from (1) :thinking:

1 Like

maybe try using a looping sound that starts and stops with the animation?

1 Like

The problem is that i added Momentum, so i’m trying to match the step sound with every step in the animation so that when the player starts running it starts off slow, then increases in speed.

1 Like

maybe adjust the playbackspeed of the sound with momentum

1 Like

No because Playbackspeed is for changing pitch and speed.

i think i have the solution!

image

you can use PitchShift SoundEffect then in the loop the playbackSpeed becomes faster!

and the PitchShift SoundEffect goes below 0 so then the sound doesn’t change Speed!

OK, i’ll try that. I’ll tell you if it works.

This kinda works, i want it to start off slow but the same pitch and then go up in speed, but again the same pitch.

Start Of Walk : Octave = 2, PlaybackSpeed = 0.5
Middle Of Walk : Octave = 1.25, PlaybackSpeed = 0.75
Walking : Octave = 1 PlaybackSpeed = 0.9

The problem here is that the sound sounds a little bit muffled, and also i want the start of the walk to be even slower but the problem is you can’t increase the Octave past 2.

I don’t understand why Roblox can’t just make 2 seperate properties for the Pitch and Speed of a Sound instead of just combining them both as PlaybackSpeed.

1 Like

Welp, in the end it worked. I guess since i couldn’t get the Marker thing to work i’ll have to stick with this. It sounds pretty normal, just would’ve preferred a way to make it work with the markers. Thank you! :smiley:

1 Like

Nevermind, for some reason now the sound still plays even when jumping.

1 Like

here how to fix (i think)

humanoid.Jumping:Connect(function()
	TheWalkSound:Stop()
end)

-- or use

humanoid.Jumping:Connect(function()
	TheWalkSound:Pause()
end)

or use humanoid.FloorMaterial as that can detect if the player is on the ground too

ooh i forgot that thing but if you do

if humanoid.FloorMaterial ~= Enum.Material.Air then
    -- here script for walk sound
end