Potential problems to look out for: not having the same geometry displayed when raytracing as you had when previewing the script. getting an object center from an object which is not in ints actual modeled position.