Get what player pressed a button
Is there anyway to know what player, in a multiplayer game, that pressed a UMG button?
Posted Apr 19, 2015, 4:17 PM UTC
78
Is there anyway to know what player, in a multiplayer game, that pressed a UMG button?
Posted Apr 19, 2015, 4:17 PM UTC
For what purpose? If for debug, then just make a debug log that reads a message once the button is pressed. If you don't know how: if you setup the hud in code, then just create a broadcast/debug message call after the code for what the button does. If you setup in BP, do the same thing, just with a broadcast/debug node.
"get owning player" node
from there u can get lots of info form "player state" for eample
remember though that "player name" is not good to differentiate between players. player ID is good but will change for every new session you start.
Pretty sure he wants to know which player pressed the button, not for which player was this UI spawned. Think of a fighting game character select screen with local multiplayer. This is my interpretation.
Yes.
ah, didnt think about local multiplayer.
its hard to help when people dont explain what they want. please explain what you want to do/what is happening?
if its like a character selection for a local multiplayer fighting http://nintendo.wikia.com/wiki/File:Character_Selection_-_Super_Smash_Bros._Brawl.png game where all select characters at the same time id just give every cursor a color or a name and then when u press it set the array item to the selected character according to player number.
explain yourself if u seek help then you would have had the answer 12h ago :P
Sorry, not local multiplayer its online.
The way I have in mind is at when the game is started all players can pick a class and the server creates the player a let the player posses it. The problem now is that since button click i multicast, when one players pick a class all players get that class.
ah, didnt think about local multiplayer.
its hard to help when people dont explain what they want.