How do I keep my levels (called pages) made using external layouts to stop looping?
What is the expected result
What should happen is that when my player hits a door, and that door variable is “page1” or “page2”, it should take the player to the external layout with that page title, as it’s read as a number.
What is the actual result
What happens instead is that when my player is on page1, and hits the door with an instance variable of 2, which equals page2, it still stays on page1
(This method of having the door instances have variables that I can reference worked because I had it working before I built up my game in a simpler version, but then I added all these variables and now it keeps looping to the current page instead of moving forward or backward in the external layouts)
I think that part of my issue is probably in changing my variables, so it’s maybe not changing dynamically? I’m just out of ideas on how to fix my issue.
So is the problem that the wrong external layout is selected, or that the game scene never reloads?
And this is probably a silly question, but is the variable of door 2 of external layout ‘page1’ actually 2 in the editor? I’ve had instances where I changed variable values because focus was on it and I scrolled the mouse wheel or used the arrow keys which changed the value.
So it’s selecting the external layout based on “currentPage” global variable, which I first set in my menu scene.
When the player hits a door, it should change to the assigned number, which represents an external layout.
Right now, it’s like reloading the current scene/external, instead of moving to what the door variable is.
So that was a previous issue I had, but I’ve since corrected it. And when I try my scene changes in a super basic practice game file, it works to change the layout based on the object’s variable.
My laptop is acting up, so later I’ll have to export a game build if anyone wants to try it out.