Hello i am making a car simulation game and i need to make an odometer to simulate tire damage and wear and so on so on

so the method to make the odometer i went with works like this

first i attach the odometer script to a tire (i chose the front drivers wheel).

now for the script the idea was this:

first i get the measurements of the tire on the y axis (the dimensions read 0.647 in BUs or 2.123ft in imperial units)

next i calculated the circumference of the tire (2.123ft*3.14) which equaled 6.66622ft

next i would get the current rotation of the x axis of the tire in degrees

then i would divide the current rotation by 360 and then check if that is a whole number

if it is a whole number then i would add 6.66622ft to a variable and then divide that variable by 5280

(my dad came up with the formula and the basis for the odometer)

then i would dump that to a game property or a text plane.

so my problem is that i don’t know how to get the current rotation of the tire period.

so how do i do that?

and i have to get the rotation of the x axis only and it has to be in degrees not radians or blender units

and also in python how would i check if a number was whole or not?

sorry for the long winded explanation

here’s the script to get the rotation

i already know how to do the math to get the amount of miles its traveled but i did up this script and it just wont work

when i debug the properties it dosen’t even show the odo property(i figured that out i need to add a .x to TireRot but now it just shows 0.000000 no matter how much the tire rotates) what am i doing wrong?

import bge

from bge import logic

import bpy

cont = bge.logic.getCurrentController()

own = cont.owner

set = own[‘odo’]

def main ():

```
Tire = bpy.data.objects["TireFD"]
TireRot = Tire.rotation_euler
own['odo'] = TireRot.x
```

thanks in advance

by the way i am using blender 2.68