Interact Button (Universal)

Hello who is reading this thread.

I’m newbie to Unity (also with English Skill)

first
I have a problem i want to create one button to interact everything in my game (like A / B button in Pokemon game which you will use A to talk with anyone or pick any Item)

second
i want to trigger thing only when my character I tried OnTriggerStay2D but it will trigger only 20-40 time and then it won’t triggered anymore, I have to move my character first to trigger event again.

Any Idea about this?

You need to keep track of UI state yourself, such that once you initiate a particular interaction, the button will no longer allow interaction until the interaction you’re currently doing has been completed.

This also enables you to cause other controls to change, such as changing your cursor from controlling the player to instead controlling the UI, as one example.

2 Likes