- Home /
How to start first person controller on terrain without falling
This is probably a simple solve, but I can't seem to set the first person controller to a position such that when the game starts it's not immediately falling. Even right on the terrain it still makes the "Land Sound" right off the bat. Is there a way to initialize the first person controller to a stationary position?
Edit: I positioned the controller so it no longer falls, however the land sound still plays immediately which is slightly irritating.
You could deactivate the audio component on start and enable it after 0.5-1 seconds so that when the character first hits the floor the audio is disabled so it won't play.
Answer by Robdon · Feb 08, 2016 at 05:12 PM
I know its old, but I've found a fix for this.
You have to change the FirstPersonController.cs script.
At the top, where it defines m_PreviouslyGrounded, set it to true.
So: private bool m_PreviouslyGrounded = true;
Then when its created, it thinks its already grounded.
Also, I found if you enabled/disable the FPSController it was playing the landed sound (last sound played), and I had to also unflag the 'Play on Awake' flag on the FPSController 'Audio Source' in the inspector.
HTHs.
I had the same trouble and your answer solved the issue, thanks!
Answer by Jonnoiscooler · May 29, 2015 at 04:25 AM
I agree with vpld, the reason the land sound plays is most likely because Unity detects a collision on start. If it didn't detect the collision your player would fall through the ground. Try disabling the sound briefly on start