How can I get my current player's index?

Hey guys, I am working in the level blueprint and I am attempting to add an impulse to an object in the direction that my player is looking. However, it is going to be for a split screen game and I need the impulse to work with both my first player and second player independently, so when the first player adds the impulse it will go in the direction that he is looking and when the second player adds the impulse it will go in the direction that he is looking. As of now I have what is pictured below. This creates a problem when the second player attempts to impulse the object, as it goes in the direction that the first player is looking. Would there be a way to get the player index to set which player is impulsing the object so the rotation will be set accordingly? Thanks a lot!

how is this function or sequence getting called? typically, you would pass in the controller or actor as a parameter into the function so the function knows which object to handle. so for example, if this is a custom event, on your event node, in the details panel, click ‘new’ and name the parameter ‘Player Controller’ and set the type to ‘Player Controller’. Then when you call this event, you would also pass in the player controller that needs to be impacted by this event. can you post what is triggering this sequence in your graph?

These are the two inputs causing this to happen. It is just a simple keystroke or trigger pull.

if you move your input from level blueprint into the player controller blueprint (or character), you will be able to more easily determine who is providing the input to then execute the event on the correct player. here’s an example:

  • create an event dispatcher that includes an input parameter for the controller

  • bind the event to the level blueprint, and call whatever function you want with that event, including the use of the player controller passed into that event. then you can determine if player 1 provided the input or player 2.

My self reference will not hook up into my player controller input on my call event for some reason? And my cast will not accept the controller reference?

Any luck figuring out what I may have done wrong?

SoocerPlayer is a player character, you need the player controller. You can’t cast a player character to a play controller like you’re trying to do in the first screenshot. Likewise, you can’t cast a player controller to a player character like you’re trying to do in the second screenshot.

Awesome! I was using a player character without a player controller, so it was not connecting correctly. Thank you both so much for the help! It works perfectly!