- Home /
Question by
el-mas-pro-470 · Jul 29, 2018 at 05:44 PM ·
car game
vehicle pitch shifting?
Hello! I'm looking for a script that modifies the pitch with marches simulating a car! I find absolutely nothing. I just found a script that accelerates the pitch and decreases but does not make the changes. Does anyone know something? Thank you!
Comment
Can you share your script with us, the one that does nothing. $$anonymous$$aybe we can help if we have a better understanding.
var $$anonymous$$$$anonymous$$ch : float = 1.0;
var max$$anonymous$$ch : float = 2.0;
var maxSpeed : float = 20.0; //tweak to your vehicle
private var pitch$$anonymous$$odifier : float;
var speed = 20;
function FixedUpdate(){
var movement = Input.GetAxis("Vertical");
rigidbody.AddRelativeForce(Vector3(0,0,movement*speed));
var currentSpeed = rigidbody.velocity.magnitude; // I think this is what I need to change
pitch$$anonymous$$odifier = max$$anonymous$$ch - $$anonymous$$$$anonymous$$ch;
audio.pitch = $$anonymous$$$$anonymous$$ch + (currentSpeed/maxSpeed)*pitch$$anonymous$$odifier;
}
Your answer
Follow this Question
Related Questions
Animation in GUI Buttons? 1 Answer
Light Glare Effects 2 Answers
Realistic car sound? 0 Answers
Car Gearbox script 1 Answer
How do i make another car in my car game to drive and chase around my track? 0 Answers