Object collision sound on impact

So I’m pretty sure you have seen this before: Roblox block collision sounds (2011 client) - YouTube I already created my own version but I don’t know how to make it better.

I tried only one way to make the system but it isn’t realistic enough.

I’ve tried watching tutorials on YouTube of advanced scripting but nothing seems to be working.

script.Parent.Touched:Connect(function(hit)
	if hit:IsA("BasePart") then
		if script.Parent.AssemblyLinearVelocity.Magnitude > 0 then
			script.Parent.Sound.Playing = false
		end
		if script.Parent.AssemblyLinearVelocity.Magnitude > 1 then
			script.Parent.Sound.Playing = true
		end
	end
end)

script.Parent.TouchEnded:Connect(function(hit)
	if hit:IsA("BasePart") then
		script.Parent.Sound.Playing = false
	end
end)

Does anyone have any advice? If so, message me instantly thanks.

2 Likes

Is the magnitude greater than 0 or 1 before it hits?

1 Like

The mangitude is 1 before it hits

It could be playing fast, then stopping right after

Way too late of a reply but I think you’re supposed to use “play:()” instead of “playing”
and “stop:()”

1 Like

I tried Sound:Play() and I also tried Sound.Ended and it sounds better, but it still doesn’t fix the problem.

It works for me, I increased the magnitude so it doesn’t go crazy

if script.Parent.AssemblyLinearVelocity.Magnitude > 6 then
			
		
		
			script.Parent.Sound:Play()
			
		end

Dont mind the “Play” you can change it however you want, but just play around with it

1 Like