now my problem is simple i believe but I have very limited knowledge in UE4 C++
I’d like to know how would i pull out the actor information which is overlapping with the current actor?
this is my ode trying to implement a health pack that will be destroyed once the actor is overlapping with it,
now i’d like to check if this player is player one or two?
also is there a way to give each player a unique ID in the network and use it to define which actor is who?
I’m new to this and trying to learn so please bare with me =D
If you know there are only ever going to be at most two players, all you really need to do is check whether the OtherActor is a Pawn (and whether it is controlled by a human player, so no AI, bots, etc.). You can do so by checking OtherActor->GetClass() against APawn::StaticClass() using the IsChildOf() function.
I’m assuming there is probably something like a unique ID but I don’t know where that would be. Worst case you’d have to give it one yourself.
If I understood you right, here’s what you should do:
On the overlapping method, as UnrealEverything said, just cross-check the class against the Actor’s class. Additionally, after you do so, you can typecast and compare: