Button enabling an entity, but only does it for one frame :(

I am trying to make it so that if you click a button, it enables a UI saying if you got the random good side or the bad side of what you picked (if you click hide, it either says “Nice!” or “You were found and lost 5 food”). The issue is that when you click the button, it enabled the UI, but only for one frame (it enabled the UI i wanted to show for one frame, then disables it immediately). How do I fix this?

Link to game: https://playcanvas.com/project/657174/overview/explorers-realm

1 Like

Hi @Werdie_Alt,

What are the steps to reproduce the issue?

I do not know what that means, lol

I press Launch and Play and the game starts. After a couple of seconds I am shown the menu and press Play again, the game starts again.

Seems to be working, so what do I do to get the problem you are describing above.

It’s been a few days, is the problem still there @Werdie_Alt?

(This account is also Werdie Games) Yes…

But if you were to go into the editor and play it there, you would play, and if you moved around, you would get a screen that says You’ve been attacked! The only button that works is the hide button, so if you click it, it does the effects of the hide button, but only for one frame. At is a fifty - fifty chance of getting a good side or bad side of “hiding”. So if you get the bad side, it says “you were found”. But it does it for one frame, enabling it, then disabling it after.

1 Like

I tried, but whatever I try it results in 2-3 seconds of playtime and me ending up here:

1 Like

The game is a bit silly but just spam the arrow keys and you will see the screen (once you click play)

Tried it again, and it seems to be behaving in a sense the UI is shown (You’ve been attacked etc.) and I can click Hide. That works each time, not only once.

Could you explain again what is the issue?

When you click hide, the button should have shown your outcome, “Nice!” or “You were found”. Does that happen?

No it doesn’t show anything after clicking hide. Could share the code that implements this to take a look?