Basically, I want to create a system for a road sound, where if a car is touching the road, the sound plays. Furthermore, I want the audio to increase in pitch as you move faster.
For Example, say 50mph is default playbackspeed = "1" and the quicker or slower you go it changes pitch.
I also want it to be a 3d sound which is attached either to the car or the head.
Any help will be appreciated! Thank you!
Extra Info:
The car's tires are named as follows: "FL" "FR" "RL" "RR"
say 50mph is default playbackspeed = "1" and the quicker or slower you go it changes pitch.
PlaybackSpeed
property. To change the pitch in relation to the speed, you would first grab the position of a part attached the car twice: once immediately and again after a given amount of time (I recommend wait(1)
). position1= part.Position time = wait() --we'll store the amount of time we waited for later position2 = part.Position
position1= part.Position time = wait() --we'll store the amount of time we waited for later position2 = part.Position distance = (position1-position2).magnitude speed = distance/time --this gets the studs/sec. rate
speed
to effect the pitch/PlaybackSpeed. For now, we'll say for every 10 studs/sec. , we'll increase it by .1 . Then set the PlaybackSpeed property I mentioned earlier to 1 + speed/rate:position1= part.Position time = wait(1) --we'll store the amount of time we waited for later position2 = part.Position distance = (position1-position2).magnitude speed = distance/time --this gets the studs/sec. rate rate = 20 --means that Playbackspeed will increase by .1 for every 2 studs/sec. increase sound.PlaybackSpeed = 1 + speed/rate