Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by DFLY · Nov 20, 2017 at 05:48 AM · scripting problemfirst person controller

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 ?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DFLY · Nov 20, 2017 at 10:14 AM 0
Share

Thanks Zodiarc. It works. But why?

avatar image Zodiarc DFLY · Nov 23, 2017 at 09:52 AM 0
Share

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.

avatar image
0

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. 

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

128 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Character refuses to fly 2 Answers

Scroll Rect not working 0 Answers

First Person Controller - Problems with footstep audio being played too fast. 0 Answers

How to disable MouseLook in ingame pause. 1 Answer

Enable a component after a specific amount of time? 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges