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 Borzi · May 29, 2013 at 08:15 AM · collidervariablesbulletprojectileparticle

Colliders won't work (Closed)

Hey, I've been having problems with Unity collider. I've already asked a similar question but this guy couldn't help me out and it just brought up more questions. The OnCollisionEnter function doesn't really seem to work. I tried out several simple collision scripts on my bullet, such as this one:

 function OnCollisionEnter() {

 

     Debug.Log("Hit Something!");

 

 }



Unity did not Log the hit. I checked on most other factors, colliders, the layer pyramid, nothing works....If someone could help or give some suggestions as to why it doesnt work, it would be a great help, this is really hindering my process. BTW this is the script i wanted to get to work initially:

 /Variables (START)_________
 
 //The particles that will Instantiate on hit 
 var mudParticle : GameObject;
  
 //Variables (END)___________
 
 function OnCollisionEnter(hit : Collision){
     if(hit.gameObject.tag == "floorMud"){
         Debug.Log ("Hit");
         Instantiate(mudParticle, transform.position, transform.rotation);
         transform.renderer.enabled = false;
         gameObject.GetComponent(SphereCollider).enabled = false;
         }
 }
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

Answer by Chronos-L · May 29, 2013 at 09:13 AM

Have you took a look at the collision matrix table at the bottom of this page?

Furthermore, I am not really sure about this code segment

 function OnCollisionEnter() {
     Debug.Log("Hit Something!");
 }

But I am sure that the following will work if the colliders are setup properly:

 function OnCollisionEnter(collisionInfo : Collision) {
     Debug.Log("Hit Something!");
 }

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 Borzi · May 29, 2013 at 11:48 PM 0
Share

Hey, so the way I fixed this was by just starting a new project. That is all I needed to do and it worked fine ^^ But thanks for the help, also turned out that the collision only works when the Bullet is at a very slow rate and a rigid body. Anyways, thanks for your help!

avatar image
0

Answer by Sebulec · Sep 30, 2013 at 12:35 PM

I have the same problem and i've tryed almost everything (install patch reset uninstall) and colliders don't work . U used simple scripts like UP and theres no reaction...

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

15 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

Related Questions

Instantiated object won't collide with particles 1 Answer

Accessing variables in enemy. 2 Answers

Bullet reflect not working properly 1 Answer

Colliders not interacting 0 Answers

Collision occurring when it should not! 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