Blueprint respawn issue (Inheritence bug?)

Hi, I’ve boiled down what’s been killing me to a test case, and I think it’s a bug in blueprint.

To replicate the bug:

  1. Take a blank scene (I used the third person blueprint template).

  2. Create 2 children blueprints based off my character (MyCharacter_Child1, MyCharacter_Child2).

  3. Create a new class based on ‘pawn’ called ‘deathPawn’

.4 Inside MyCharacter - On begin play, store your current controller into a variable, then create actor ‘deathPawn’ and store the reference to it inside another variable.

  1. Inside MyCharacter - On any input - From your controller variable call ‘unpossess’, then call ‘possess’ and input your controller variable and your death pawn variable.

  2. Inside deathpawn, using the ‘on possess’ event, store a variable of your new controller.

  3. Inside deathpawn, create 2 inputs (anything will do) which spawn MyCharacater_Child1, and MyCharacter_Child2 respectively, unpossess death pawn and immediately possess the created characters.

  4. Inside the default ‘mygame’ set it to spawn one of your myCharacter_Child’s. Doesn’t matter which one.

Essentially it’s a simple setup where when you die, you can respawn as a class of your choosing based on a default character class. I can provide pictures if the instructions were unclear.

If you play the explained project above, it will work just fine, the code works, and everything seems good. But if you exit the project, when you load it back up, trying to open any blueprint in the project will crash UE4, trashing the project completely as you can’t even get in to undo it. If anyone has any idea what might be happening here please let me know!

Ok, I’ve managed to simply the test case much further:

New way to create the bug:

  1. Third person template based on blueprint
  2. Add the following simple set-up to the MyCharacter class: http://screenpresso.com/=XI31g
  3. Create a child of MyCharacter
  4. Set MyGame to spawn the child as the default pawn

You can test it, hitting ‘p’ will spawn a new character and then - to possess it (though it does only work once).

But from this point, if you close the project and re-open it, attempting to open any blueprint will crash UE4.

Moved it over to here: https://answers.unrealengine.com/questions/69979/storing-a-variable-of-a-spawned-child-class-breaks.html

As I got it broken down further. To repeat the answer here: I’d accidentally stored a reference to a child object as a variable in the parent, which caused the freak out.

Hey Hennez,

Just wanted to check with you before I mark the issue as resolved, You have fixed the issue correct? (Based on the accepted answer in this report: https://answers.unrealengine.com/questions/69979/storing-a-variable-of-a-spawned-child-class-breaks.html)

If it has not been resolved, please do let me know.

Thanks and have a great day!

Yes it’s all sorted out, thanks for checking :slight_smile: