Quantcast
Channel: Answers for "Array index confusion - what does [i-1] do exactly???"
Viewing all articles
Browse latest Browse all 8

Answer by ginryu

0
0
um, first off, you implementation is off. gear speed is based on a gear ration, you make a varible, or an array and make it float[] then set the index to 2 then you make a variable called gear ratio, lets say you make someFloat[0] = 20 and someFloat[1] = 40 you then have gear ratio = somefloat[0]/somefloat[1] then you take your enginepower and divide it by gear ratio,by simply changing someFloat[1] you can get a large variety of outputs. you want to also add a final gear ratio. now this system will allow you to create a very realistic engine/ transmission/ and differential setup. now i do regret having to say that a high ratio will give a weak output, by adding a torque multiplier, to the low gears that decreases as you shift into higher gears where engine power then makes up for low gear power problems. the next step is to apply a gear resistance factor to decrease eng power as pressures slow down the wheel rpms. which would cause the transmission to shift down and increasing gear torque again which compensates for the deceleration caused by climbing hills or sudden increases in drag. however i have yet to find a way to implement this plan. after i finish writing my global control script,i can once again continue testing of the system i just told you. and please, if you figure out this puzzle, i swear you will have created a vehicle control script where just changing 2 values can alter a vehicles performance quite a bit. allowing easy, and very easy to calculate car performance. ill post the code along with explicit directions on setup. also this setting will allow for very realistic rotations of gameobjects, such as drive shafts, camshafts, crankshafts. which i am actually planning on doing. control of All scripts will be done from the global control script. 1 update. and 1 fixed update. im hoping to use Time.deltaTime to apply forces, hopefully this can allow me to avoid fixedUpdate lag. i noticed that having more than a few of these drops performance radically. i must admit though, that that may be due to a mistake in my programming. my email is kristopher.j.logan@gmail.com. and if you need more info on gear ratios and the like howitworks.com is a very good resource on a large variety of subjects. search gear ratios, engines, transmissions, and differentials, torque, and horsepower. i dont understand torque calculations. i studied the content and learned a great deal, even though i was able to implement this knowledge, low gear torque still eludes me. and oh, use rigidbody.velocity.x/y/z to limit the velocity of the vehicle at low gear. oh and use TransformDirection() to switch it to global. as the very high low gear torque multiplier will cause unrealistic low gear car velocitiies. only apply this right at the drive wheels, you don't want to apply it before the differential as it will mess up animation values. ive done alot of thinking on this. and please forgive the typos. im using my android smart phones remote mouse app. as my keyboard broke:( so if this post looks unprofessional, thats why

Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images