Is it possible to restrict a player's input so that they can only perform certain tasks?
Hey guys! I am in need of help creating a system that restricts input on a player, but doesn't completely get rid of it like the "Disable Input" node would. I need to restrict one action, but still allow the player to walk around. For example, I am creating a soccer game where the player has to be near the ball to kick it. I have recently figured out a way to return the player index and set a Boolean that lets the game know which player is close to the ball. As of now, I am setting a Boolean called "Close1" when player 1 is near the ball and "Close 2" when player 2 is near the ball. However, I have no way of disabling the "Kick" button for one player when the other player is near the ball, thus allowing player 2 to kick the ball if player 1 is near it. Would there be a way to disable the "Kick" button for each player until their Boolean, "Close1" or "Close 2", is activated?
TLDR: I need the "Kick" button to be deactivated for each player until they get close to the ball.
Thanks so much!
Yes, simply dont bind the keys or dont use the key press events.
You could also put a branch at the key event to enable toggling.
In your case the boolean that dictates what execution branch is executed could be a check to see if the ball is closer than your threshold.
Follow this question
Once you sign in you will be able to subscribe for any updates here