- Home /
How do I access the first FirstPersonController script in the FPSController ?
Can't seem to figure out what is wrong. I just want to turn off the footstep sound of the FPSController when it exits a trigger box (steps off hard surface onto soft).
I can't even access the FirstPersonController script. ie.
void Start () {
Debug.Log ("fpscontroller = " + GameObject.Find ("FPSController").GetComponent<FirstPersonController> ());
}
I get the error message Assets/Maze/Scripts/FootstepTrigger.cs(12,82): error CS0246: The type or namespace name 'FirstPersonController' could not be found. Are you missing 'UnityStandardAssets.Characters.FirstPerson' using directive?
Is the first person controller a reserved object or is it because the script is in a prefab or is it because Unity doesn't like me today ?
Answer by Zodiarc · Nov 20, 2017 at 07:29 AM
Have you tried exactly what the error says? Just add
using UnityStandardAssets.Characters.FirstPerson;
on top of the file and see if it works.
by using the use-statement you told the compiler where he has to search for the class. Before that it was searching in the global namespace (looku up namespaces in C#) and couldn't find it.
Answer by Multiwilliam25 · Jun 08, 2020 at 12:57 AM
Hello, I am new to Unity, I have even purchased the "Unity From Zero To Proficiency (Foundations) book by Patrick Felicia, and in that book it specifically asks me to download this assets for a tutorial, but unfortunately it has an issue. under the Assets>Standard Assets>Characters>First Person Controller>prefabs is the FPSController has missing scripts, and I am still too new to Unity to try to fix, I just downloaded it right from the Unity Assets Store and it came out missing its scripts, which I don't know how to add or resolve, so I can't continue with my tutorial until i can resolve this issue. Please help me.