Car mechanics setup in upbge 2.5

You can’t “create car sounds” in Blender (You can import & modify sound files tho)
You can however, play sounds in Blender & one of it’s game-engines (Vanilla or UPBGE)

Logic-Bricks way is to use the Sound Actuator.
Python way is to use the AUD module.

Bro i know that we cannot “create” car sounds in UPBGE, i just want to ask you that how to modify a car sound so that with our increasing speed of car, the volume of the sound increases, and when our speed decreases, the sound decreases, this is what I want to achive.

1 Like

I would modify the volume pitch with python ( idk python but it’s possible ) OR use different sound files with high , medium and low speed , switching to different one by a property increases when you press a button , and decreases when you not . So , search for some or make one , OR download gt8 file by Atomic Skill and take a look at the sounds folder

1 Like

this is correct

1 Like

First of all, I’m not going to create a script for you even tho I can.
You’ll never learn Python if you don’t learn to create things on your own (I believe you can do it)
I will however share the needed code functions for getting the sound-volume & the car-speed.

You can get the speedof the object with -

import mathutils
mathutils.Vector(gameObject.getLinearVelocity()).magnitude

Then, for getting the sound volume use the Python + Actuator way.

import bge
bge.logic.getCurrentController().actuators["Sound Actuator"].volume

(or)

The Python + AUD module way -

import aud
aud.device().volume

most game engine attributes are already vectors. no need to recreate it.

1 Like

Bro you know, I cannot do it for the issues as follows
1: I live in INDIA, a country where we hardly get any time to use pc’s and the people gere think that this is a complete waste of time.
2:I am in std 10th, in India this year is extremely important, so I cannot learn to code in this year.
3: And lastly, I am only 14 yrs old! I am not able to do so much, I have did some programming outside blender in python, but i do not know about it in the game engine.

Therefore I am not able to learn to code

1 Like