Once and Always activation bug

So sometimes while coding a once or an always will just not want to work.
An example is here:


This code is meant to check if the player went into the settings level and then save the position the player was at so the player doesn’t have to restart everytime they go into the settings and come back to the level. The once behavior is one of the core behaviors to this since it’s supposed to check once everytime the player enters a level. But the once only activates once during the whole game. Instead of activating during the beginning of each level. This is annoying and is what led me to delete some games since I didn’t have any other option. The reason this is in the help requests is because I don’t know if this has happened to others and if it is intentional or if it is truly a bug.

2 Likes

Do you have any examples of where an Always block refused to work?
Have you tried re-loading the game tab?

1 Like

Not anymore unfortunately, since I deleted those because I abandoned them because of that. I’ve reloaded the tab multiple times when I first encountered the problem. It didn’t work, which has led me to assume it is intentional instead of a bug.

1 Like

Can you describe how the always acted when it bugged?

I’ll take a closer look at the code. Have you tried running the code in the editor? -To see what was stopping the system from working.

1 Like

Yes I had ran the code from the editor, it seems that the once activates but once I switch between levels it doesn’t activate again.

The always would be similar to the once but instead of working once and then stop working it just didn’t work at all.

1 Like

Did you see the white outline of the once and always behaviors turn slightly yellow? If so, then it did activate, and the problem probably lies in the coding.

If the triggers once and always didn’t grow lighter/activate, then there is likely a bug behind it.

If it didn’t activate, then you should probably switch this topic to bug reports.

1 Like

Yeah I just double checked, it didn’t. It then definitely is a bug.

1 Like

Hmm… so far, I haven’t encountered anything like this. We’ll have to wait and see if any other users have.

1 Like

Yeah this is really messing up my remake on The Escape of The Unsavable, I’m probably just gonna turn it private until this is fixed

Just delete the once/always and get a new one.

1 Like

Don’t think I’ve tried that?

1 Like

Is the object set to “Keep between levels”?

1 Like

No.

Okay so if all the other options of what people said don’t work:

I think what is happening here is you are playtesting the game by selecting the player object on the Level editor, which means when you see its logic it only shows the logic triggers for that object (this is represented in the bottom left corner with a text saying “Viewing Logic from Object 123”.
So every time you change the level, a new player object is created/loaded, so the object won’t be the same as the one you selected on the editor.

image

If you want to see the Logic running from ALL player objects, you have to open the Object Behaviors from the Library on the bottom toolbar.
image

Basically the Once is still running on all the player objects, you are just not seeing it on the preview because that player object was deleted once you loaded a new level.

Hope this helps! :smiley:

2 Likes

Thanks! I’ll try this right away.

Sadly, it didn’t work as I checked in all Player objects so the once still doesn’t wanna go.
Here’s the link to the game

You could find the code in the player in a bundle named “Keep Player Pos”

1 Like

This is happening with me too! My game is totally broken because an always is acting like a once!

And IT’S ONLY ONE OF THE ALWAYS BLOCKS!

And then it works again. Strange.

1 Like

The worst part is if you use a timer and make it count 0 seconds and repeat it forever it doesn’t work either!

I had to scrap ideas I’ve wanted in my game because of this bug.

why not use an always block instead?

Because it doesn’t want to work?

1 Like