If you have spawn your 2nd character from the game mode, you can store it variable and from your character bp, call GetGameMode > (your 2nd character) > set variable.
I have considered using begin overlap but I prefer using the method shown in case of actors starting overlapped or having conditions reset while overlapped so as not to require another overlap ‘beginning’.
My problem does not involve the use of a second character.
I tried using two different interface functions to set and unset the variable in the character BP and this still did not work.
The node GetActorofClass, will return only the first instance of your character bp.
If you have ThirdPerson_0 and ThirdPerson_1 on the level map, it will only return ThirdPerson_0.
So you can either do a GetAllActorsofClass and loop them or a way to presave the variable actor of your 2nd character (ThirdPerson_1) such as spawning it.
In the healing actor use Begin and End overlaps to call the BPI events on the pawn.
In the pawn set a bool or enum state (preferred) when the healing starts/ends.
Use the state on tick in pawn to print.
The healing zone (actors) only job is to call the healing events. Nothing else should be in that class. More so the collision component should only trigger overlap events when a pawns capsule component overlaps it.
Using a BPI and setting up your collisions correctly mitigates the need to cast to class. does implement interface is the only condition that needs to be met.
Thanks for figuring this out for me. I will try to reproduce it myself. Although it does seem similar to what I tried, hopefully I can find out why yours works and mine didn’t.
Thank you again very much. It does seem like a good working solution.
EDIT: I am really just confused because my attempt did work as intended, but only for one copy of the healing zone actor. All the copies performed their own logic(print string) but only one would set the variable in the Third Person Character BP.
UPDATE: It seems to work well enough now.
The Begin and End overlaps seemed to be the biggest fix here as I continued to have the same problem when using my original (is overlapping node[on tick]) method.
My only guess as to why this is happening is that only the original sphere component is being counted for the overlap and any copies are being counted as different components. Apparently the behaviour is different with the begin/end overlap nodes.
I did create a new Object Response Channel for PawnCapsule, but I think there must be some more setup that I’m unaware of to actually make it sense the pawn capsule.
When I hit play, the print string fires as Healing even though nothing is overlapping the healing zone. (Collision settings are set to ignore everything except Pawn which is set to overlap)
I fixed this by setting the enum to ‘not healing’ on beginplay.
The Switch Has Authority node. It only works when I drag out of the authority pin, not remote.
Other than those differences, I do think this will be a good enough solution for now.
I can foresee problems with needing to rely on the begin/end overlap nodes, such as spawning on the healing zone possibly not triggering a begin-overlap and disabling the healing zone while overlapping may require an additional overlap to reset healing to ON, but I can address that potential issue if it does ever present itself.
Thank you very much to everyone for helping with this.
UPDATE#2: I got my original method working. The problem was that I was using a for each loop to cycle through the healing zones. I needed to use for each with break.