Author Topic: coding problem  (Read 430 times)


lets say value 1 base value is 10.
value 2 base value is 20
when value 1 is 10, i want value 2 to be 20
but when value 1 is 0, i want value 2 to be 0 aswell, instead of value 2 being 10 (20-10)
help?

double value2 = value1 * 2.0;

double value2 = value1 * 2.0;
noo urgh
you dont get it
i dont want it to be exactly twice
i know how to do that
say value 1 is 4999 and value 2 is 600, how do you go about that?

Not entirely sure what you are asking for here.

When you modify one or the other you have to modify them both. You would also need a ratio for what value 2 should be compared to value 1.

Not entirely sure what you are asking for here.
i am doing a engine with a gearbox and i have a problem with rpm, when i try to remove gear force rpm from the rpm it makes the rpm go negative
say youre in gear 1 and you go, and you change to gear 2 and when you stop you have negative rpm, i want it to be as many as in gear 1 without the car having idle rpm for 2 seconds after launch
hope this isnt too confusing

You need to make a set function that makes value2 = value1. So like when you make a gear change call the set function setting gear 2.

It's called gear ratios. engineRPM = wheelRPM / gearRatio;