I have an actor that the players can interact with, so the first thing I do is enable input on the actor when a player enters its trigger volume. Most tutorials and such that I see do something like this.
I have three questions.
The problem with the above blueprint, is that it is just enabling input for the player at index 0. So clearly this approach does not work in a multiplayer environment. So instead, I’m connecting the Other Actor pin to the Player Controller pin (using a cast to the Player Controller of course). I assume this will then enable input on the actor for the specific player that has entered the actor’s trigger volume, right?
Does Enable Input keep track of multiple players that can have input on the actor? For example, when Player1 enters the trigger volume, they have enabled input on the actor. What happens if Player2 then also enters the trigger volume? This would cause Player2 to enable input on the actor. Does Player2’s “enable input” overwrite Player1’s original “enable input,” or does the actor keep separate track of the fact that both Player1 and Player2 now have input enabled on it?
If both Player1 and Player2 have now enabled input on the actor, how do I tell which player is trying to interact with the actor? For example, if I add an E key Input node to the actor’s blueprint, it just gives me a pin for Pressed and Released. I have no information to tell me which player it is that has pressed E on the actor? How do I find out which player (from the Player Controller pin on Enable Input) pressed E.