Mirror material works in blender but does not work in standalone game? I have made a game with mirror material using the Render To Texture script. When I hit P in Blender, it works. But when I Saved as Runtime Game and opened my runtime game file, the mirror material was black and did not work. 

Why it doesn't work and how to make it work?

The result when I export game to Runtime:

Traceback (most recent call last):
  File "/opt/Blender/2.72/scripts/addons/io_export_pc2.py", line 156, in poll
    return context.active_object.type in {'MESH', 'CURVE', 'SURFACE', 'FONT'}
AttributeError: 'NoneType' object has no attribute 'type'

location: &lt;unknown location&gt;:-1


The code I use for mirror relfection:

######################################################
#
#    RenderToTexture.py        Blender 2.50
#
#    Tutorial for using RenderToTexture.py can be found at
#
#    www.tutorialsforblender3d.com
#
#    Released under the Creative Commons Attribution 3.0 Unported License.  
#
#    If you use this code, please include this information header.
#
######################################################

#import GameLogic
import GameLogic

# get current scene
scene = GameLogic.getCurrentScene()

# get the current controller
controller = GameLogic.getCurrentController()

# get object script is attached to
obj = controller.owner

# check to see RenderToTexture has been added
if "RenderToTexture" in obj:

    # update the texture
    obj["RenderToTexture"].refresh(True)

# if RenderToTexture hasn't been added 
else:

    # import VideoTexture module
    import VideoTexture

    # get a list of objects in the scene
    objList = scene.objects

    # get camera name being used for render to texture
    camName = obj['cam']

    # get camera object
    cam = objList[camName]

    # get the texture material ID
    matID = VideoTexture.materialID(obj, "MA" + obj['material'])

    # set the texture
    renderToTexture = VideoTexture.Texture(obj, matID)

    # get the texture image
    renderToTexture.source = VideoTexture.ImageRender(scene,cam)

    # save RenderToTexture as an object variable
    obj["RenderToTexture"] = renderToTexture
For some reason the obj["RenderToTexture"].refresh(True) makes it not work. If I change it to obj["RenderToTexture"].refresh(False) it works also in standalone for me. Strange...