Make an Effect Happen Only on the first time the player enters a room (SOLVED)

idk if the title actually states the problem well, but it’s midnight by now and I’m tired.

Here’s what I’m trying to do:

  1. When the player enters a new room, the journal on the GUI starts its grow/shrink tween. This is to tell the player that there’s a new entry in the journal.
  2. This is only supposed to happen when the player enters a room for the first time. If the player backtracks to previous rooms, the journal’s tween doesn’t activate.
  3. Pressing the button to check the journal also stops the journal’s tween. It’s not supposed to activate until the player enters a new room.

The problem is that none of this is happening. The journal’s tween will only activate one time and then never again. I tried changing the code but then the tween keeps going even after the player closes the journal.


EDIT: It can work for the first two rooms, but then it doesn’t work for any of the other rooms. If I move between Room 1 and Room 2, the tween activates, but if I move between Room 2 and Room 3, it doesn’t activate. I wrote the programming for all rooms the exact same way.

It might be a long process depending on the rooms. But i can garuntee you it works. First create sprites for each room and in event sheet turn them all invisible. The create boolean variables for each room too. Now place the each individual sprite at the entrance and if player is in collision with that sprite and boolean is false then the journal animation happens and then the boolean turns true. Like that if the player again goes to the same room then it wont happen again because the boolean would be true.

1 Like

Variable, Is Global Var “First Entry” True

If “First Entry” False---------------------------------- Do effect, Set "First entry to true
If “First Entry” True----------------------------------- Do Nothing

1 Like

Thanks for your guys’ help. I scrapped the scene variables for the rooms and replaced them with the object variables for the rooms. I also split up the rooms by it’s size to keep things organized. Then I took off that When True statement because it was getting in the way.

Now the journal’s tween activates only on the first time you enter a new room’s borders (yellow for big rooms and white for small ones). If you choose to open the journal or not to open it, it will only activate that one time, which is exactly what I needed!

1 Like

you dont need the second line of code because do nothing is not a code, instead just dont write a line of code you dont need the second one