Hey guys,
I have a scene which works absolutely fine when I run it directly in the editor. However, when I run it from what is the “control panel” in my game, the first person movement script in the scene doesn’t take any WASD commands. The mouse works fine, but I cannot move the player. Only happens when I switch scene from another one that has WASD controls to do different things.
The starting scene is https://launch.playcanvas.com/992466?debug=true. To reproduce the error, press P, and then the Back To Control Panel option. Once in the control panel, use the arrow keys to select the option “Go to refining bridge” on the screen directly in front of the camera. There, the script should allow the person to move freely using WASD, but this does not happen. The screen recording below shows the same.
https://www.dropbox.com/s/pieloip0nwx5rn6/e7272265-e7cd-4384-896f-122ac32ba1f4.mp4?dl=0
However, if I run the refining bridge scene on it’s own, it works fine - https://launch.playcanvas.com/989324?debug=true.
From the scene changing tutorial, I understand that the old hierarchy is destroyed. In this case, why is this happening, and how do I resolve it?
This code editor link has all relevant scripts open - https://playcanvas.com/editor/code/719288?tabs=35577599,37307297,37155761,35593864
In order - The Fly.js script is the script in the starting flight scene. The btcp.js script changes the scene to the control panel from the pause menu. The cycle.js script changes the scene to the refinery(lines 233-241 only), and the first-person-movement.js script is self explanatory.
How should I proceed?