Download

How can i make a boolean value true but at only 1 player

Hi, I wanted to ask a question. **How can I make a boolean variable true but only one player and the rest of all players is false? **Thank you

You have to have a check that control , wich player is doing this action? wich actor ? or pawn? wich playercontroller own them?

if you place a coin in your game, that print " You are the chosen one " but only if is the player 3.
Lets say : player 1 use"Alien" , P2 use “Robot”, P3 use Ninja,
the coin can use on begin overlap - get other actor - "get player controller of actor " is == to get player controller 3 ? if yes do something

You can also run a custom event to return value based on the input.
like a door, with a boolean to say “Locked” or not
When a player reach the door and call a custom event OpenDoor, with a custom input “player controller”
you fill the custom event you use the GetPlayerController to make the event run.
The event will check the input incoming,
if is player 1, and door is locked , print “Door is Locked” set another bool to 0
if is player 2, and door is locked , print "Door is Locked, but maybe i can open this door " bool to 0
if is player 3, and door is locked , print “For me the door magically opens” bool to 1

you have to use different nodes based on who is the owner if you dont use some kind of storing variable for the controller

get the player controller of actor Get Controller | Unreal Engine Documentation
get the player controller 0 (the first) Get Player Controller | Unreal Engine Documentation
get the owner of the camera Get Owning Player Controller | Unreal Engine Documentation
get the owner of the widget Get Owner Player | Unreal Engine Documentation