• 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
-1
Question by logang · Feb 10, 2013 at 04:32 AM · colliderjavanot found

collider not found (java)

i have been making a game and it says collider not found and i dont know why. i tried UnityEngine.collider but other errors started showing up plz help i am a little bit new to java i only know a little bit but i cant find out what im doing wrong Plz help

Assets/Tower.js(53,40): BCE0018: The name 'collider' does not denote a valid type ('not found'). Did you mean 'UnityEngine.Collider'?

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 adrenak · Feb 10, 2013 at 05:44 AM 0
Share

Post your script, this is a scripting error after all

avatar image iwaldrop · Feb 10, 2013 at 07:07 AM 0
Share

Yeah, posting your code helps, but the error message is telling. DO you mean UnityEngine.Collider? "Collider" and "collider" are different. Collider is the class, collider is the instance attached to the gameObject.

avatar image logang · Feb 10, 2013 at 04:00 PM 0
Share

sorry if the code shows up 2x here it is:

pragma strict

 var myProjectile : GameObject;
 var reLoadTime : float = 1f;
 var turnSpeed : float = 5f;
 var fireSpeed : float = .25f;
 var muzzleEffect : GameObject;
 var errorAmount ; float = .001f;
 var myTarget : Transform;
 var muzzlepositon : Transform[];
 var turretBall : Transform;
 
 private var nextFireTime : float;
 private var next$$anonymous$$oveTime : float;
 private var DesiredRotation : Quaternion;
 private var aimError : float; 
 
 function start() {
 
 }
 
 function Update() {
 
     if(myTarget) {
     
         if(Time.deltaTime >= next$$anonymous$$oveTime) {
         
             CalculateAimPositon(myTarget.position);
             turretBall.rotation = Quaternion.Lerp(turretBall.rotation, desiredRotation, Time.deltatime*TurnSpeed);
         
         }
     
         if(Time.time>= nextFireTime) {
         
         FireProjectile();
         
         }
     }
 }
 
 
 function OnTriggerEnter(other : collider) {
 
     if(other.GameObject.tag == "Enemy"){
     
         nextFireTime = Time.time+(reloadTime*.5);
         myTarget = other.GameObject.transform;
     
     }
 
 }
 
 function OnTriggerExit(other : collider) {
 
     if(other.GameObject.tag == myTarget){
     
         myTarget = null;
 
     }
 }

 function CalculateAimPosition(targetpos : Vector3) {
 
     var aimPoint = Vector3(targetpos.x+aimError, targetpos.y+aimError, targetpos.z+aimError);
     desiredRotation = Quaternion.LookRoration(aimPoint);
 }
 
 function CalculateAimError() {
 
     aimError = random.range[-errorAmount, errorAmount];
 
 }
 
 function FireProjectile() {
 
     audio.Play();
     nextFireTime = Time.deltaTime+reloadTime;
     next$$anonymous$$oveTime = Time.deltaTime+firePauseTime;
     CalculateAimError();
 
 
 
     for(the$$anonymous$$uzzlePos in muzzlePosition) {
     
     
     Instantiate(myProjectile, the$$anonymous$$uzzlePos.position, the$$anonymous$$uzzlePos.rotation);
     Instantiate(muzzleEffect, the$$anonymous$$uzzlePos.position, the$$anonymous$$uzzlePos.rotation);
     
     }
 }

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by flaviusxvii · Feb 10, 2013 at 04:17 PM

Case Matters! collider is not the same as Collider.

Also, Java is a programming language that is NOT used with Unity. You're writing a variant of javascript. They are unfortunately named.

Comment
Add comment · Show 8 · 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 logang · Feb 10, 2013 at 08:00 PM 0
Share

I know that but when I do that 20 more errors show up

avatar image flaviusxvii · Feb 10, 2013 at 08:45 PM 1
Share

Well you have about 20 more errors in the file.. here's some of them..

Time.deltatime should be Time.deltaTime // AGAIN CASE $$anonymous$$ATTERS

Quaternion.LookRoration should be Quaternion.LookRotation

random.range[-errorAmount, errorAmount] should be Random.Range(-errorAmount, errorAmount)

.. that's just a start. Go to each error that Unity tells you and fix your problems.

avatar image flaviusxvii · Feb 10, 2013 at 08:46 PM 0
Share

errorAmount ; float should be errorAmount : float (colon not semicolon)

avatar image logang · Feb 11, 2013 at 01:16 AM 0
Share

Okay thanks

avatar image logang · Feb 11, 2013 at 01:30 AM 0
Share

Okay so i went though and did most of them but there is 3 i do not know about (remember I am some what new to unity) here they are: 1:Assets/Tower.js(28,33): BCE0005: $$anonymous$$ identifier: 'CalculateAimPositon'.

2:Assets/Tower.js(46,51): BCE0005: $$anonymous$$ identifier: 'reloadtime'.

3:Assets/Tower.js(70,40): BCE0055: Internal compiler error: Array index is out of range..

Show more comments
avatar image
0

Answer by logang · Feb 10, 2013 at 05:19 PM

Here

pragma strict

 var myProjectile : GameObject;
 var reLoadTime : float = 1f;
 var turnSpeed : float = 5f;
 var fireSpeed : float = .25f;
 var muzzleEffect : GameObject;
 var errorAmount ; float = .001f;
 var myTarget : Transform;
 var muzzlepositon : Transform[];
 var turretBall : Transform;
 
 private var nextFireTime : float;
 private var nextMoveTime : float;
 private var DesiredRotation : Quaternion;
 private var aimError : float; 
 
 function start() {
 
 }
 
 function Update() {
 
     if(myTarget) {
     
         if(Time.deltaTime >= nextMoveTime) {
         
             CalculateAimPositon(myTarget.position);
             turretBall.rotation = Quaternion.Lerp(turretBall.rotation, desiredRotation, Time.deltatime*TurnSpeed);
         
         }
     
         if(Time.time>= nextFireTime) {
         
         FireProjectile();
         
         }
     }
 }
 
 
 function OnTriggerEnter(other : collider) {
 
     if(other.GameObject.tag == "Enemy"){
     
         nextFireTime = Time.time+(reloadTime*.5);
         myTarget = other.GameObject.transform;
     
     }
 
 }
 
 function OnTriggerExit(other : collider) {
 
     if(other.GameObject.tag == myTarget){
     
         myTarget = null;
 
     }
 }

 function CalculateAimPosition(targetpos : Vector3) {
 
     var aimPoint = Vector3(targetpos.x+aimError, targetpos.y+aimError, targetpos.z+aimError);
     desiredRotation = Quaternion.LookRoration(aimPoint);
 }
 
 function CalculateAimError() {
 
     aimError = random.range[-errorAmount, errorAmount];
 
 }
 
 function FireProjectile() {
 
     audio.Play();
     nextFireTime = Time.deltaTime+reloadTime;
     nextMoveTime = Time.deltaTime+firePauseTime;
     CalculateAimError();
 
 
 
     for(theMuzzlePos in muzzlePosition) {
     
     
     Instantiate(myProjectile, theMuzzlePos.position, theMuzzlePos.rotation);
     Instantiate(muzzleEffect, theMuzzlePos.position, theMuzzlePos.rotation);
     
     }
 }
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 flaviusxvii · Feb 10, 2013 at 07:00 PM 0
Share

Change other : collider to other : Collider. Case $$anonymous$$ATTERS.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

12 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

Related Questions

Android SDK Install Help 0 Answers

Internal collisions 1 Answer

OnTriggerEnter (Slow Player Speed) Need Help! 2 Answers

Error with trigger PLZ HELP!!!! 1 Answer

Collider not found 0 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