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
-1
Question by Riebulka · Apr 23, 2013 at 06:52 PM · collisioncarwaterbomb

Collider Don't work

I making a game. You need bomb car and heal with water...

 var Gyfka : int;
 var GoodTag : String[];
 var BadTag : String[];
 var Ugnis : Transform[];
 var Dumai : Transform;
 var Groteles : Transform;
 var Ratai : Transform[];
 var Sprogimas : GameObject;
 
 function OnCollisionEnter(other : Collision){
 Debug.Log("Test");
     if (other.collider.gameObject.tag == GoodTag)
     {
     Gyfka += 6;
     }
     if (other.collider.gameObject.tag == BadTag)
     {
     Gyfka -= 37;
     } 
 }
 
 function Update(){
     if(Gyfka >=25){
     Dumai.particleEmitter.emit = true;
     }
     if(Gyfka >=10){
     Ugnis.particleEmitter.emit = true;
     }
     if(Gyfka >=1){
     Instantiate(Sprogimas, Groteles.transform.posion, Quaternion.identity);
     Ratai.GetComponent(HingeJoint).enabled = false;
     }
 }
 
 function OnGUI(){
 GUI.Box(new Rect (10,Screen.height - 200,200,20), "Riebulkos Mašinos Sveikata:" + Gyfka);
 }

I working with this script for 3 days. It starts me angry WHAT I DID WRoNG I put this on car's collider

Comment
Add comment · Show 4
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 KiraSensei · Apr 23, 2013 at 07:10 PM 3
Share

You posted 16 $$anonymous$$utes ago, so first : be more patient ... Second : there is no question !

What is the problem ? What is happening ? Or what is not happening and should ?

avatar image insominx · Apr 23, 2013 at 07:12 PM 0
Share

This might help you understand things better: Unity Tips and Tricks

avatar image KiraSensei · Apr 23, 2013 at 07:17 PM 2
Share

You are comparing a tag with a list of string, does this even compile ?

avatar image Graham-Dunnett ♦♦ · Apr 23, 2013 at 09:33 PM 2
Share

Post a question that explains in more depth the problem you have. Being angry, and working on it for 3 days isn't enough information for anyone to help you. It might take the community a day or more to help you. The more detail you can add about the problem, the better your chances of getting help.

1 Reply

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

Answer by Graham-Dunnett · Apr 23, 2013 at 09:43 PM

So, I copied your code into a project I have open. I got the following errors:

 Assets/blah.js(27,15): BCE0019: 'particleEmitter' is not a member of 'UnityEngine.Transform[]'.  
 (Filename: Assets/blah.js Line: 27)
 
 Assets/blah.js(30,51): BCE0019: 'posion' is not a member of 'UnityEngine.Transform'.  
 (Filename: Assets/blah.js Line: 30)
 
 Assets/blah.js(31,15): BCE0019: 'GetComponent' is not a member of 'UnityEngine.Transform[]'. 
 (Filename: Assets/blah.js Line: 31)

So you have at least 3 problems. I don't understand why you have arrays of Strings and Transforms. Those look wrong to me. Usually what you have defined as Transforms would be GameObjects. You use posion where you mean position.

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 Riebulka · Apr 24, 2013 at 09:52 AM 0
Share

Thanks Graham Dunnett ♦♦ You saved my day there was error on array and poison :D THAN$$anonymous$$S

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

14 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

Related Questions

Car dynamics? 0 Answers

Help with car collision in arcade racing game 2 Answers

Getting contact force between two rigidbodies 1 Answer

Make the player not able to walk in/on water 3 Answers

2d car end line error help 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