Hey. As the title suggests I’ve been looking into different possibilities regarding how player characters could move from being able to damage other players to not being able to in a dynamic fashion, inside the game.
The interest in this comes from the desire to create a server with PvP and PvE zones, where a players ability to damage other players/structures will change depending on where they are geographicly.
My idea for setting up the actual zones on the map is simply through Sphere Triggers, with the switch occuring through the OnActorBeginOverlap event, and the OnActorEndOverlap respectively. (Switch PvP on when entering, and off when leaving)
The problem arises in how to actually alter what a player can and cannot damage. I can’t figure out any way to alter this other than directly altering blueprints, which of course would still just leave it in one single state that won’t switch back and forth ingame.
I’ll keep on looking for a way, but if anyone dev or not has any idea about this that’d be great!
Edit: One way to go about it could be to create an extra PlayerPawn for each gender that has DamageAdjusters set so that they can’t be damaged by players. The issue then becomes if it’s possible to switch a player’s PlayerPawn blueprint for another one.
The best thing to do would be to change the DamageAdjusters during runtime, but I’m not sure if you can do that. Your idea of switching the player pawn could potentially work (I don’t really know unless I tested it myself). One way I can think of doing this is by spawning in your PVE (or PVP) pawn, and then have the player’s controller posses that pawn by using the Posses function.
Looks to me that you just need to add a script to a blueprint that looks for any PlayerPawns in the vicinity and toggle their Actor: Can be Damaged attribute when they enter/leave the area. Be sure to have spawn in immediately check what this attribute should be set to. One could go even so far as changing all extremities damage multipliers to 0 (also in this same blueprint) except for specific areas say for example the head for headshot only damage.
As far as I understand though this is equivalent to activating god mode so the player would not be able to take any damage outside of your arena, but maybe this could be better suited to create safe zones on your map.