Making the player invincible in Shadows (TriggerZones)

I’ve made an enemy chase the player using OnSeePawn and Casting on my player character. However, I’d like to make the PawnSensing to a minimum when the player enters a Shadow zone where a Trigger Volume has been placed.

This is my PawnSensing code that the enemy uses to follow the player:

I added a Trigger Volume to the shadowed areas such that when the player enters them, the field of vision of the enemy can be reduced. However my blueprint doesnt work:

My blueprint is obviously wrong, which part is incorrect folks? :slight_smile:

Add a visible/editable integer “inShadow” variable to MyCharacter, when the player enters a shadow you increase the value by one, when he exits the volume you decrease the value by one.

In the On see pawn, you get the inShadow Paramter from the character, after you cast it to MyCharacter.
get the inShadow from the MyCharacter and do a comparison.
inShadow == 0.
Connect this output to a gate, connect the true output from the gate to the AI Move To node.

if you havent entered a shadow or if you have entered and exit the same amount of shadows (safty if moving from shadow volumes that intersect) then the inShadow integer is zero.

That sounds great :smiley: Could you guide me with the Blueprint, good sir? I’m new to it so I don’t quite know which methods to call :smiley: Thank you very much for the answer :smiley:

I can’t. But now atleast you have the theory and somewhere to begin your learning. :slight_smile:

Okay I shall look in to it. Thank you very much for the answer, sir :slight_smile: