Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Bejasc · Mar 21, 2013 at 10:21 AM · charactercontrollermissingdefinitionmissing-reference

Character Controller missing reference on almost any script.

I've been pulling my hair out with this problem. It's happening for multiple scripts. The example I'll use is because it is freely available to the public.

The errors I am getting are the following

Type CharacterController' does not contain a definition for velocity' and no extension method velocity' of type CharacterController' could be found (are you missing a using directive or an assembly reference?)

Note for this error, the error is in regards to CharacterController.velocity. In fact, anything that is trying to be called from CharacterController throws up the same errors, only replacing velocity for what it is trying to call.

I've tried deleting and re-importing the character controllers from the standard assets, and just installed unity 4.1.0f. All folders are in their default locations.

I was having this error on the previous version, and didn't find a way around it, but the error was not bugging me as much then.

As an example for a script this happens to (there are many), see the following http://wiki.unity3d.com/index.php/FootstepHandler I see no reason why it shouldn't work, but for some reason it does not.

TL;DR

Anything trying to be accessed from the CharacterController throws up 'CharacterController does not contain a definition for 'whatever it's trying to access'

Update; I've tried uninstalling, and reinstalling the following versions (3.5.6 || 4.0.0 || 4.0.1|| 4.1.0||) with no luck.

Comment
Add comment · Show 3
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 Freaking-Pingo · Mar 21, 2013 at 01:12 PM 0
Share

Could you by any chance, upload some of your own code? Or are you directly copying the code from the FootstepHandler example?

avatar image Bejasc · Mar 21, 2013 at 01:26 PM 0
Share

Thanks for the reply Pingo, I actually solved it, and it was a rather embarrassingly-simple solution.

Some time ago, I had a script called CharacterController. Named exactly the same as the component. It was trying to call up all of these things from the scrip I had, where they of course didn't exist. At the time I made the script, I was unaware it would cause conflict, and while I was trying to solve this conflict, I had completely forgotten about the script.

So all is now good :) Still, thanks for taking your time to help look into it.

avatar image Freaking-Pingo · Mar 21, 2013 at 01:27 PM 0
Share

Its cool, glad you solved it :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by aldonaletto · Mar 21, 2013 at 11:32 PM

@bennyboy2321 solved the problem himself, but this is frequent enough to deserve an explanation: scripts are components, just like Rigidbody, CharacterController, Renderer etc. If one save a script as Renderer.js, for instance, it will hide the original Renderer component, causing lots of mysterious errors like the one above.

The hint is: whenever some standard and widely known component mysteriously disappears from Unity, look for some script innocently saved under the same name.

NOTE: Unity always complains when someone tries to save a script with the name of an Unity's component, displaying a warning and a message like this in the console:

Script 'Renderer' has the same name as built-in Unity component.
AddComponent and GetComponent will not work with this script.

Comment
Add comment · Show 1 · 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 tasaif · Jan 16, 2020 at 04:14 AM 0
Share

I had just added assets from the store. This solved my problem, thank you.

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

13 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

Related Questions

The referenced script on this Behaviour is missing please help. 2 Answers

Method reference dropping from OnClick() 1 Answer

why does character controller accelerate off ledges? 1 Answer

CharacterController.Move() is causing unwanted vertical movement . . . how to fix? 2 Answers

Character controller problem 2 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