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 WeirderChimp · May 29, 2014 at 11:27 AM · collisionrigidbodyoncollisionentermeshcollider

OnCollision Not working can someone explain

hey im trying to write a script for a destruction type thing

but i need to attach a rigidbody then a object is hit by a ball (this object has a mech collider)

Im firing a ball from the player it has a rigidbody attached(obviously)

but when it hits an object with my script attached that has

onCollisionenter and then attaches a rigidbody and also does other stuff

but on collision enter doesnt get called

also i tryed adding a rigidbody on the object that the ball is hitting and set it to kinematic and onCollision got called (couldnt attach rigidbody cause it already had one)

but for what im doing i CANT have a rigidbody with kinematic checked for the object that the ball is hitting.

SO IF someone could explain whats happening that would be great becasue i though this should have worked (i have been using unity for quite a while so im not a complete noob. well i thought i wasnt)

sorry for any spelling mistakes i wrote this quickly

~Scott

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by meat5000 · May 29, 2014 at 11:52 AM

Perhaps attach a child object with a kinematic rigidbody and use that for the collisions

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 WeirderChimp · May 30, 2014 at 06:55 AM 0
Share

i have a thing i call a beam in my script this beam acts as a support these beams are then connected with joints(and have rigidbodys) to make a shape of a building. so if you destroy the bottom one the building collapses its to calculate the structural integrity of the building. later what i call rubble in my script are children of this beam. now the idea was for these beams be not colliding with rubble which they do(not collider that is)and if the rubble gets hit by a rigidbody it would call onCollisionEnter which would calculate if the bit of rubble will break off. if it did break off it would be unparented and a rigidbody would be added to it. now the problem is that if i dont have a rigidbody oncollisionenter doesn't get called when my rigidbody sphere hits it with the correct amount of force to break it off. and if i have a rigidbody attached to the rubble with kinematic set to true(so it doesnt move) it can detect the collision and then i can set is$$anonymous$$inematic to false which is all good. but if this beam is standing up and it has rubble all around it and it falls over the rubble just clips through the ground and doesnt effect the beam at all. its like the rubble isnt even there.

pictures the white cube is the beam and are individual objects childed to the beam(rubble)

alt text

One is where the rubble doesnt have rigidbodys attached and i will attach them if the rubble breaks off. but they dont register OnCollisionEnter

and the other is where the rubble is clipping through bthe ground and doesnt effect the beam at all but accept collisions

thanks for reading

if you have any ideas on how to fix this please reply or even any other methods of doing what im trying to do would be great

thanks ~Scott

alt text

untitled1.png (176.1 kB)
untitled.png (134.1 kB)

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

21 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

Related Questions

Collision Only being detected on one of the objects involved in the collision - C# 0 Answers

Anyway to make my object not fall through the floor without convex? 0 Answers

what object hit me? easy rigidbody question 1 Answer

Fast moving object not detect collision 3 Answers

Why I've a gap between meshcolliders? 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