Hi,
I am making a race game and i want a minimap.
I created a setup with 3 scenes (Game with hud overlay | Hud with minimap render to texture | minimap with the rendercam and map)
But when i run this it doesn’t give any error it just gives me a bright green image
my code (Executed by Hud minimap-image):
import bge
def render():
controller = bge.logic.getCurrentController()
obj = controller.owner
scene_map = None
for scn in bge.logic.getSceneList():
if scn.name == "Minimap":
scene_map = scn
break
if scene_map is not None:
if "RenderToTexture" in obj:
obj["RenderToTexture"].refresh(True)
else:
scene = bge.logic.getCurrentScene()
objList = scene_map.objects
camName = obj['camera']
cam = objList[camName]
matID = bge.texture.materialID(obj, "MA" + obj['material'])
renderToTexture = bge.texture.Texture(obj, matID)
renderToTexture.source = bge.texture.ImageRender(scene,cam)
obj["RenderToTexture"] = renderToTexture
Any idea how to fix this?
My goal is to have it like this:
kind regards,
winspeednl