This is my code:
def textanim(): print("GOGO") print("end") scene = bge.logic.getCurrentScene() print("end") scoreAnim = scene.objectsInactive["scoreAnim"] print("endNach anim") scoreSpawn = scene.objects["TextSpawn"] print(scoreAnim) print("end") c = scene.objects["Cube"] newText = scene.addObject(scoreAnim,scoreSpawn) newText["anim"] = True print("all lines were ececutet (hopefully)")
This is my result:
As you can see, not all the lines are executed, but there aren't errors either.
As Chebhou said the problem is the line where i try to load the FontObject:
scoreAnim = scene.objectsInactive["scoreAnim"]
I copied this at the beginning of another function and than this function isn't executed anymore.
So there is any problem with loading Font objects. Although I have it on an Inactive layer
This function should duplicate a score text object. The duplicated object than should then play an animation and slide to a corner. The score is saved.
Here you can download the .blend
2D car Game