I’m working on a multiplayer splitscreen game in which I have run into a problem. When my player2 character is not visible on player1’s camera, he does not animate, but he can still move around etc.
Here is my splitscreen.py (slightly adopted to add players and get camera’s):
import bge cont = bge.logic.getCurrentController() width = bge.render.getWindowWidth() height = bge.render.getWindowHeight() scene = bge.logic.getCurrentScene() objList = scene.objects player1 = scene.addObject("Player",objList['p1spawn']) player2 = scene.addObject("Player",objList['p2spawn']) cam1 = objList["P1Cam"] cam2 = objList["P2Cam"] scene.active_camera = cam1 cam1.setViewport( 0, int(height/2), width, height) cam2.setViewport( 0, 0, width, int(height/2)) cam1.useViewport = True cam2.useViewport = True objList['p1camSpawn'].setParent(player1) objList['p2camSpawn'].setParent(player2) cam2.setParent(player2)
I’m guessing the problem is related to scene.active_camera. Is it possible to have 2 active camera’s?
Anyone have any thoughts or suggestions?