#failed attempt at making a car transmission

1 messages · Page 1 of 1 (latest)

undone shell
#

sometimes it can change into 6th and -1st gear and it'll cause null reference exceptions

#

so i think there's a mistake in gear changing logic somewhere

#

it changes gears uncontrollably, like, every tick it can

undone shell
#

i feel like it should be obvious but i can't see it

undone shell
#

logs tell me that the coroutine that does the gear changing is called like a million times a second
not sure what makes it do that

rocky timber
#

use the debugger to follow the flow of the program

upper totem
#

The conceptual flow is wrong here. When you think of a car and all of its parts and what they individually manage, would you think that your suspension would control your gearbox?

Right now, the ChangeGear coroutine is being started by your torque calculation which (assuming each wheel holds its own ref to suspension) is being called 4 times or more on every fixed update