I made a blueprint (character) for NPCs that I am using with my AIController. The NPC has a boolean that can be toggled by the player. Problem is that when I drop 20 of the NPCs into level and the player toggles the boolean on one of them, it toggles it for all of them.
The NPC is a Character class because the player can possess / control them. If there is a different / better way to do this, please let me know.
So, I guess, long story short… is there a way to instantiate Character blueprints in the same way you can Static Meshes?
The player walks up to the NPC and presses E to interact. This interaction flips the boolean. So, in theory, because each NPC is from the same blueprint… flipping the boolean will effect all of them.
The NPC is a blueprint which I manually placed into the scene 20 times. The blueprint is not a child or parent of the anything. Could this be a problem also? Not quite sure… still guessing…
I don’t see how instantiating the characters helps you properly set your bool. Actually, if it worked the same way as static meshes it would be 20 or none just like you are experiencing now.
I don’t think you need to make your NPC’s characters for them to be possess-able. Players can possess pawns, though I am not sure the specifics of how all that works. Using a pawn is probably what you really want to do. Just have to work out how the player possesses it. I think there is a checkbox for “Is pawn possess-able” and make sure you have movement controls, though I think this should basically stay with whatever the player possesses.
Does each NPC have it’s own boolean or is it one for all? If it is only one boolean you may need something else to keep the rest of the NPC’s from activating at the same time. You could try one boolean per NPC, you could use gates, etc. You may just need to have your AI controller get the specific actor that was activated and run it’s scripts on it.
We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.