- Home /
After Restarting Scene, Player can't move anymore
I created a simple Scene with a SceneManager implemented as a Singleton.
When using only that scene, It works flawless.
Then I added a restart button and problems started.
Initially I had some NullReferenceException Issue: I found the cause, the problem was due to some arrays of the singleton istance that were not cleared; the script found an array with x elements, but all of them were null references. So I added some code in the Start() function in order to check if the array is empty or not. If it isn't I clear the array (before the start the array must be empty, if it is not, it's an array of null references).
After solving all the NullReferenceException issues (that drove the application to crash), I am still not able to make the application run after restart.
The new issue is that the player, whose GameObject is defined in the scene as a GameObject with a CapsuleCollider, a RigidBody and a RigidBodyFPSController, doesn't move after restarting. I think it's a problem with the attached script that maybe are not created again after restarting.
Any idea?