Having a major issue with changing a layout on a platform based game.
I'm going to describe the problem as best I can as I am unable to upload the capx and I have been unable to repeat the problem in a new project so please bear with me.
The player is set to a basic Platform behaviour with custom key movement.
Layout 1 properties
PlayerX - 40
PlayerY - 4000
Layout 2 properties
NumberFall = 3
Player is outside layout
Numberfall is > 3 Set player position to (60, 3000)
Numberfall = 3 - Change to Layout 1
On the 2nd layout if the player falls outside of the layout then the player is set back to 60, 3000
After the 3rd fall the player is sent back to Layout 1
When the player re-clicks the link to return to the second layout the Player is being moved to the co-ords of 600, 600 and after it lands destroying itself.
No where in my code is that set to happen.
I really hope I've done enough to get some idea's from other people on how to solve this as I'm stumped.
Sorry again for not being able to upload a bugged capx for people to look at.
So more information I have found that has confused me even further.
I set up a key press that sends the player from the 1st Layout to the 2nd Layout.
This method is working perfectly no matter how many times I go back and forth.
Any idea's on why the clicking with a mouse button is causing issues when the event for clicking and keyboard press are identical apart from the difference between a mouse and a keyboard?
Develop games in your browser. Powerful, performant & highly capable.
Found the problem, uploaded the version to a web server and tested it on several machines in case it was an error on my console.
Turns out the way the events where positioned inside of Construct was the problem.
The move player function was 3rd on the start of layout where it should have been in the 1st position.
Hope this helps anyone who may suffer a similar problem