Download

How Can i Make The Trigger Volume Result Seen Only By The Player Who Overlapped With it ?

Hi, I’m Trying to Build a Multiplayer game but i have a problem that my character overlaps with the trigger zone the result of overlapping is seen by all other players in the map and that’s not the case i want. I want each player overlapping with the trigger volume to see the result of overlapping alone and make the others can’t see the result only if they also overlap with trigger volume.

My Case : i’m making a top down shooter game i want the players when they overlap with trigger zone inside a room, the ceiling of that room become half visible and all this logic is already done but like i said my problem that all the players when one of them overlap with trigger zone all the players see the result but i want each one of them to see the result if they are in trigger volume

any suggestion and thanks

Hello,
It depends on the way you build your logic but you can use a “get overlapping actors” and from the array array, cast it to your “character” and only the ones from this result are set with info (using a tag or bool for example to verify)

Thank you Fen For your Answer, This is my simple logic that i made can you tell me how make your suggestion work in here ? and thank you

This would work but you don’t need so much. (my bad)
I supposed at first that maybe more characters than the one overlapping would see the result but it seems that only the overlapping player does so here is an easier way to by using the “other actor” output node (and if 4 players overlap they will all have it but not other ones)

In player character, i create a custom event (you can use it to set your material parameters in your character instead your trigger and even can use this for different triggers).
In level blueprint, from the trigger volume “begin overlap” node i use a “cast to character” linked with “other actor” too, then if other actor is a character, i’ll have access to all is in including my custom event that i call. If you have issues don’t hesitate to come back.

overlaptrigger.jpg

Cast to Pawn and call IsLocallyControlled should do the trick.

Thank you Fen, I Did Exactly like you suggested but it’s the same problem .

this is how the test look like :

as you can see, there’s three different player 1 inside the trigger volume and the other 2 are outside but the outside ones can see the result of the trigger volume effect and what i want is that the only the player in the trigger volume can see the ceiling or the roof half visible and the other 2 can’t see the effect.

and thank you

I finally found something maybe usefull, but not the best imho.
I didn’t realise that the material you want to change is not on your character but on another actor and i am not over skilled in replication. So there maybe a better way but after some searches what i found is a way to make what you want visible to a character only by using the “owner only see” node. I hope someone else give a better result but while that here is mine.

I have a blueprint (Bp_Target) with 2 basic cylinder (with basicshapematerial and the parameter color) in, one for reference “visible” check, second one “visible” not check.
Then i do the same i did upper. First i set character color (as still thought that was what you need : M_ue4 man_body parameter bodycolor)
then i set the owner of the blueprint Bp_Target and set visibility and color on overlap and get back on end overlap by a toggle and unset owner.

As i said someone with better replication skills may have a better solution ^^

Thank you Fen, I will Take your Solution and try But i Found a better solution by casting the other actor node to pawn cast and use isLocallyControlled Function and it worked perfect but now i’m looking for a solution using the Trigger Volume variable in The CEILING_CHANGE_VISIBILITY event (Type : Array of Trigger Volumes) that contains all my trigger volumes that are going to use this event because in the CEILING_CHANGE_VISIBILITY event i made a logic that from an array of trigger volumes, it takes only one Trigger Volume which is the one overlapped by the character itself and perform the logic on it, and now i want to find a solution to make only one OnActorBegin/EndOverlap that takes as a reference the trigger zone returned. is that possible and thank you