I made these blueprints to spawn the correct character class blueprint and then possess it. It worked in all the levels I had but now when I create a new level it doesn’t work. When I call on the player character to do something after this code I get the error “Attempted to access Sorcerer_BP_C1 via property x but Sorcerer_BP_C1 is pending kill from function”. This only happens in new levels that i create and in my existing levels it works. I don’t get how this error can be level-based.
I tested the nodes through print strings and all seems to be happening correctly. The print string that can be seen in the screenshot, that prints the player character after the possess returns the correct name, so the class selection is happening correctly.
I thought it would be a problem with the DestroyActor node that destroys the playercharacter, so the player controller gets destroyed and the possess node cannot call it anymore, but that doesn’t seem to be the case, the controller doesn’t get destroyed with the DestroyActor node, and it’s working in my existing levels so it must be working correctly.
Any ideas why I get the error “Sorcerer_BP is pending kill” ?
Thanks in advance!