edited October 2015 in ORK Support
I (a beginner) make a simple chest event to give player 5 potions, add the event to a chest prefab, it runs but it's not right, when the player press enter at the chest, he gets 5 potions, but when I press Enter at the chest again, the chest opens again he gets 5 potions more, and more like that, it's supposed to display "The chest is empty." but it's not.

Here's my event:

image

image

image

image

What I don't understand here is I tried to set the float "counter" variable to 5 at the end but seems like it doesn't work, it reset when the event called maybe?

I find that using "Deactive after event" will make the chest disappear and prevent the bug from happening but it's not the correct way to do. Can you tell me where did I go wrong?

image
(the component screenshot)
Post edited by gamingislove on
  • When you're using Object game variables, you'll need to add an Object Variables component to the game object. Otherwise there's no way to identify the game variables connected to the game object :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • thank you :D I will try that
  • Adding the Object Variables component fixed it :D thanks again GiL, you and Ork are awesome!
Sign In or Register to comment.