Why don't my NPC's act like instanced copies?

In the video (which shows the current state of the Beat Em Template), you see first one NPC by themselves. As with the characters, they are color coded. This is the GREEN npc.

After that NPC is defeated and the notifier appears and the player moves up the street, he approaches a building I think I named NPC spawner. There two Green NPCs will be spawned just a few seconds of each other. You can see in the vid that when one perishes they both do.

But I did set the Green NPC health integer in the game mode to be an instance.

Let me preface this a bit. The other day I thought about adding a mechanism like on Final Fight where when you strike an NPC a hud appears briefly showing that NPC’s name and health bar. The only way I found to do this was for say Green NPC, have one widget for Player 00 in the upper left corner of the screen.

And then for Player 01 one in the upper right corner of the screen.

I would also do like Final Fight and make it when the NPC is defeated the NPC’s health hud would be Xed out and flash.

Inside the Green NPC’s actor blueorint (just an actor, not a character or pawn, nothing), I first get refs to these 4 HUDS, 2 living Green NPCs and 2 Dead.

Then you just tie these into your logic for hit reactions of the Green NPC and the resoective HUDs.



When you see the two NPC’s die in the video, in the Green NPC bp, right after the event tick, I check if the Green NPC’s health is 0, if so, it goes to Daath (my word for a video game “death”)


When it comes to making this Beat Em Up template, I really want to give it some of the imo best elements from classic BEUs. The weapons of Double Dragon, the dash and special ability of Golden Axe. And of course, the NPC HUD of FInal Fight.

I asked a question the other day here, should EACH NPC be unique? And the answer I got was no it did not have to be. Yet, why is it not acting as an instance then? The variable is set to such in the game instance.

Does the widgets need to be instanced? How? lol

I don’t get it, please someone help me out here. Thanks.

If you take an actor blueprint and set a variable to instance editable, you can drag the actor into the level and modify the variable in the details panel for each actor you drag in. For variables in the game mode idk what instance editable is used for but it is never going to be two seperate variables as you are expecting. You either need a health variable for each npc in the game mode or a variable in each npcs blueprint.

1 Like

Ahh I see. Just for dragged in actors. So to manually spawn there is no way to do instanced copies you know of?

Unfortunate, which mean they will ALL have to be unique then essentially.

“Instance Editable” means that, when there is an instance in the level of that actor, you can edit it. That’s all. It doesn’t say “this actor gets instanced.”
You claim that:

I did set the Green NPC health integer in the game mode to be an instance.

There is only ever one game mode instance. “Instance editable” on properties of the Game Mode doesn’t make much sense, because there’s no in-scene representation of the Game Mode.

Typically, you’ll want to store the health of a particular character on the pawn instance of that character actor. Thus, add “Health” as an attribute on your NPC Pawn class, and store the health of each pawn in that value.

1 Like

Hmm so you think each actor should have their health inside their own actor bp? I am learning here. Thanks for your time.

You were right. I made the health integer for the GreenNPC inside its actor bp. And doctored up the huds and used get all actors of class for the green NPC and get a copy and it seems to be working as I would have wanted in a “Final Fight” sense. The part of the vid where two green NPCs come out of the door can now be defeated separately. Thank you! Thought it was the same commentator. Thanks all who posted!