Hi everybody,
I am a beginner with UE4 and i want to try some replication application.
It’s a kind of tagging game with health point.
If one player touch another, the second loose one point. Nothing really difficult i think.
To do that i use 3 functions :
//Client ask to server if he can hit an another character
UFUNCTION(reliable, server, WithValidation)
void askForHit(MyCharacter *otherChar);
//Server, if client can touch, send a multicast function to every client and server to find who is touch the other character
UFUNCTION(reliable, NetMultiCast, WithValidation)
void giveHit(MyCharacter *otherChar);
// If the client IS the other char i apply damage
void takeHit(MyCharacter *otherChar);
I try to find the hit client with MyCharacter->id (i create an id for every connected character) with something like this :
void takeHit(MyCharacter *otherChar){
// here if i display Role i can correctly see the role (3 or 1)
// if i try to display this->id i can only see the id of the initial client (the one which try to touch)
if (otherChar->id == this->id)
//apply damage
}
My problem is in this function which replicated correctly, the this->id is the id of the client calling “askforhit”
Is there a way to retrieve the attribute of the client where the multicast is executed ? Maybe i tried to do something wrong ?
ps : Sorry for my english