Problem with health being shared between blueprint instances

I’ve run into a really strange and annoying problem tonight when trying to spawn a second player for the first time. I have a single playable character BP at the moment for testing the basic mechanics, so I’m using 2 instances of it. The character spawns fine (no player controller attached at the moment) but if I try to attack it in any way, the character I’m using is registering the damage as well (though only the first character’s health bar is depleting) and when the health drops all the way, both instances of the character die???

To make sure, I set the second instance to be set as Player 1 rather than player 0 and I’ve also tried changing all instances of Get Player Controller to Get Controller to avoid having them look at the same source.

The health is completely setup and managed inside the Character Blueprint, not the controller.

I think the issue is resulting from the way I’m creating an Object Reference for use throughout the blueprints.

If this is indeed the case, is there a way I can modify this so that it doesn’t tie to a specific instance like this? Or do I need to get rid of this and just manually cast the 20+ times throughout?

Any help is greatly appreciated!

Make sure that when you cause damage, you check at the collision time that the hit actor is not the controlled pawn. (get controlled pawn). Inflict damage to that one only.

Thanks for the idea but I’ve gone that route just to make sure :slight_smile:

Which blueprint does this snippet belong to?

Sorry Nick. This is from my Character Controller BP.

I am not sure I follow you. Is it in Character BP or Player Controller BP?
What’s “Character Controller BP”?

It might be easier if you zipped up the project and uploaded it here (or google drive).

Zip up everything except the following folders:

* Binaries
* Build
* Intermediate
* Saved

That way, the content should be minimal. Also, please exclude Starter Assets from the upload. Make a note on whether or not they are required. I can always add a local copy before running the project.