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 HawkSP · Feb 24, 2018 at 05:12 PM · unity 5javascriptmeshcolliderenable and disable scriptmember

BCE0019 "enabled" is not a member of "Object"(On JavaScript Script)

Basically, I am making a psychology game and I want to make it so you can't collide with an object ahead of you until you collide with one before it. Therefore I want to turn off MeshCollider so they won't be able to collide before I want them to.

I am getting this Error: Assets/Objectives/Objective1.js(17,21): BCE0019: 'enabled' is not a member of 'Object'.

 #pragma strict
 
 private var objManager : ObjectiveManager;
 var ob2;
 
 function Start()
 {
     objManager = GameObject.Find("3rdPersonController").GetComponent(ObjectiveManager);
     ob2 = GameObject.Find("Objective2").GetComponent(MeshCollider).enabled;
 
 }
 
 function OnTriggerEnter (Col : Collider)
 {
     if(Col.tag == "Player")
         {
             ob2.enabled = true;
             Destroy(gameObject);
             objManager.objective1 = true;
             objManager.objective2 = false;
             objManager.objective3 = false;
             objManager.objective4 = false;
             objManager.objective5 = false;
             objManager.objective6 = false;
             objManager.objective7 = false;
             objManager.objective8 = false;
             objManager.objective9 = false;
             objManager.objective10 = false;
             objManager.objective11 = false;
             objManager.objective12 = false;
 
         
         }
 }

The "Objective2" is an object in my scene which I want to be turned on after the collision

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
0
Best Answer

Answer by HawkSP · Feb 24, 2018 at 05:38 PM

Nevermind FIXED: #pragma strict

 private var objManager : ObjectiveManager;
 private var ob3 : MeshCollider;
 
 function Start()
 {
     objManager = GameObject.Find("3rdPersonController").GetComponent(ObjectiveManager);
      ob3 = GameObject.Find("Objective3").GetComponent(MeshCollider);
 }
 
 function OnTriggerEnter (Col : Collider)
 {
     if(Col.tag == "Player")
         {
             ob3.enabled = true;
             Destroy(gameObject);
             objManager.objective1 = false;
             objManager.objective2 = true;
             objManager.objective3 = false;
             objManager.objective4 = false;
             objManager.objective5 = false;
             objManager.objective6 = false;
             objManager.objective7 = false;
             objManager.objective8 = false;
             objManager.objective9 = false;
             objManager.objective10 = false;
             objManager.objective11 = false;
             objManager.objective12 = false;
         
         }
 }
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
avatar image
1

Answer by ShadyProductions · Feb 24, 2018 at 05:23 PM

 var ob2 : MeshCollider; //shouldn't it be this?
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

189 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 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

Cannot remove sprite using destroy 1 Answer

Can Any Body Help me how to setup jenkins with unity3d 5.3.4 for automatic builds???? 0 Answers

Disable the previous variable? 2 Answers

Setting Scroll View Width GUILayout 1 Answer

Can i use Standard Assets into my project? 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