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 /
This question was closed Feb 09, 2015 at 02:04 AM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Xdy · Jul 22, 2012 at 08:42 AM · bce0019

BCE0019: 'height' is not a member of 'UnityEngine.Collider'.

Error at 'height' and 'radius'

 @script RequireComponent(Rigidbody, CapsuleCollider)
 
 function Awake (){
     rigidbody.freezeRotation = true;
     rigidbody.useGravity = false;
     myTransform = transform;
     mainCameraGO = gameObject.FindWithTag("MainCamera");
     weaponCameraGO = gameObject.FindWithTag("WeaponCamera");
     rayDistance = collider.height * .5 + collider.radius;
     playerWeapons.animation.wrapMode = WrapMode.Loop;
 }
Comment
Add comment · Show 2
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 whydoidoit · Jul 22, 2012 at 08:54 AM 0
Share

Height isn't a member of Collider perhaps it's the member of a particular kind of collider for whichj you would need a cast.

(collider as SphereCollider)

avatar image Seth-Bergman · Jul 22, 2012 at 09:10 AM 0
Share

no, this should work with a capsule collider.. is it possible there is another collider on the object as well?

2 Replies

  • Sort: 
avatar image
2
Best Answer

Answer by ScroodgeM · Jul 24, 2012 at 11:23 AM

 @script RequireComponent(Rigidbody, CapsuleCollider)
 
 function Awake (){
     rigidbody.freezeRotation = true;
     rigidbody.useGravity = false;
     myTransform = transform;
     mainCameraGO = gameObject.FindWithTag("MainCamera");
     weaponCameraGO = gameObject.FindWithTag("WeaponCamera");
     var sphereCollider = gameObject.GetComponent(CapsuleCollider);
     rayDistance = sphereCollider.height * .5 + sphereCollider.radius;
     playerWeapons.animation.wrapMode = WrapMode.Loop;
 }

Comment
Add comment · Show 3 · 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 Xdy · Jul 24, 2012 at 02:26 PM 0
Share

Changing the script I got BCE0005: $$anonymous$$ identifier: 'sphereCollider'.

avatar image ScroodgeM · Jul 24, 2012 at 06:56 PM 1
Share

type 'var' before variable. i'd fix answer. don't like JS.

avatar image Xdy · Jul 25, 2012 at 10:14 AM 0
Share

Yes! it solved, thx!

avatar image
3

Answer by Seth-Bergman · Jul 22, 2012 at 10:04 AM

try explicitly typecasting it:

 var myCollider = gameObject.GetComponent(CapsuleCollider);
 myCollider.height... etc.

oh and please don't use answer field for comments

Comment
Add comment · Show 4 · 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 Xdy · Jul 23, 2012 at 10:38 AM 0
Share

Can you explicitly typecasting that for me?

avatar image Kasia_Wieciorek · Feb 09, 2015 at 02:01 AM 0
Share

Sorry Seth, it doesn't work for me, I am getting BCE0019: 'mycollider' is not a member of 'UnityEngine.GameObject'.

avatar image meat5000 ♦ · Feb 09, 2015 at 02:04 AM 0
Share

Perhaps you should construct a new question. The error code is the same but your case is different.

avatar image Kasia_Wieciorek · Feb 09, 2015 at 02:16 AM 0
Share

meat5000 everywhere :P

Thanks, I will.

Follow this Question

Answers Answers and Comments

8 People are following this question.

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

Related Questions

Android BCE0019 error with UnityEngine 1 Answer

Ani.Mate error when port a PC game to iPhone 2 Answers

enabled doesnt work iPhone 1 Answer

BCE0019: 'height' is not a member of 'UnityEngine.Collider'. 1 Answer

Enabling / Disabling C# Scripts - Why am I getting the error "not a member of 'UnityEngine.Component'"? 1 Answer


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