Python float bug?

Hey. I’m using a version of a track-to script I wrote before the python re-write. And no, I can’t just use a track-to actuator. The main object should track to the cube on the x,y-plane. (Yes, the track-to actuator does this too.) Here’s the script:

controller = GameLogic.getCurrentController()
own = controller.owner

cube = GameLogic.getCurrentScene().objects["OBCube"].worldPosition
pos = own.worldPosition

dX = cube[0] - pos[0]
dY = cube[1] - pos[1]

from math import sqrt
hypot = sqrt(dX**2 + dY**2)

own.worldOrientation = [[-dY/hypot, dX/hypot, 0.0],[-dX/hypot, dY/hypot, 0.0],[0.0, 0.0, 1.0]]

It looks good to me (maybe not?) but the console says “one or more of the items in the sequence was not a float.” But they all are. I used the print function on each one, and they all came up as floats. I used the float function on each one, and it gave the same error. I’m getting frustrated. :mad: Could this be a bug in the new Python? Let me stress one more time that I can’t use the track-to actuator in my particular case. This is just an example script with the problem. Thanks for any help. :wink:

EDIT: I just realized I can just put an empty at the target position and track the empty, but it would still be nice if someone could tell me why the floats in the matrix aren’t being recognized as floats.

EDIT take 2: Ha. I’m an idiot. Forget it.:o