Car sound changing with speed?

Hello,

is there a way to make the car sound change with speed? For instance as the car is accelerating the sound changes, and if it decelerates the sound changes as well?
Could you please post .blends, as it makes it much easier to understand what is going on.

Thanks!

You’ll have to learn scripting for that, particularly the aud module. If you want an example. go hunt down ‘Sky Pilot’ in the finished game forum. It has a changing engine sound in it.

The aud Module won’t be needed in this Case. If the Sound is being played via Sound Actuator, the Car Script can access that and modify Volume and Pitch (bge.logic.getCurrentController().actuators[0].pitch, I think) according to the Car’s Speed via getLinearVelocity(0).

Exactly. If I have time this week I’ll make a demo.

Here is an example that uses pitch to adjust the sound of an engine: https://github.com/Moguri/barnstormer/blob/master/src/scripts/player_controller.py

Thank you very much! :slight_smile:

I am very grateful of you :). Thanks.

Never knew that! I guess I missed the easy solution.