Car tipping.

I have a bge game with a top-heavy physics car, I changed the settings to help keep it upright but it still falls over in extreme cases.

Does any one know how I can flip it back up again, where it tipped over?

own.alignAxisToVect((0,0,1),2,.5)

Thanks BluePrintRandom I knew it had to be something like that.

No problem, if you need it to be more precise , you could use a raycast to tell the last time it was on the map

Ray-z(map)---------python

import bge
cont=bge.logic.getCurrentController
own=cont.owner
sens=cont.sensors['Ray']
if sens.positive:
    T= own['GroundTime']
    T+=1
    if T>5:
        own['LastHitPosition']=sens.hitPosition
else:
    if own['GroundTime']>=1:

       own['GroundTime']+=(-1)