
Sometimes, due to the implementation of new features we need to go back and update our programming due to incompatibility of these functions. The collectable pick-up function we created in an earlier lesson is one of these instances; respawning makes the player character no longer able to pick up collectable items.
This happens when the player character despawns; the game doesn’t move the existing character back to the respawn pointโit creates a clone of the character. As a result, any data stored on the original character, such as the “keys collected” counter, is lost and no longer tracked by the newly spawned character.

To fix this, we need to move the Keys Collected counter somewhere else. Drag select, cut(cmd+X) and Paste(cmd+V) this node chain from BP_ThirdPersonCharacter to BP_ThirdPersonGameMode. You will need to recreate the Variables and Event Dispatcher on the left in BP_ThirdPersonGameMode.

We will now need to Update BP_[Item]Collectable as above. Note that the Key Pick Up node needs to be recreated now referencing BP_ThirdPersonGameMode.

BP_LockedDoor will also need to be updated with the red highlighted nodes. Please note that you will need to recreate the Keys Collected variable as the existing one is attached to BP_ThirdPersonCharacter, not BP_ThirdPersonGameMode.

Finally we need to update the highlighted red nodes in this section of the WBP_HUD widget. As before, please replace the nodes even if they have the same name, as they are referencing BP_ThirdPersonCharacter, not BP_ThirdPersonGameMode. Compile and test.
Clean-up
Return to BP_ThirdPersonCharacter, go to Edit > Delete Unused Variables. This will remove any now unused variables.
