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 Recluse · Jun 09, 2011 at 11:02 AM · colliderontriggerenterdetection

Trigger no longer registering scenery

I'm at my wits end here. I have a player collider which suddenly refuses to detect the scenery in my level.

It was working fine only yesterday. I made a few changes to meshes and object orientation and now it doesn't work. No changes were made to collision matrix or layers.

OnTriggerEnter simply fails to detect the scenery all of a sudden. The maddening thing is, the collider will detect pickups, but not scenery. The only way it will detect scenery is if I replace the scenery mesh collider with a box collider - not very useful.

Does anyone know why my mesh colliders could suddenly have stopped working?

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

4 Replies

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

Answer by Bunny83 · Jun 09, 2011 at 12:57 PM

Ok, some points:

  • The whole collision/trigger-system is part of the physics system.

  • Collisions or trigger messages can only be generated by non-kinematic rigidbodies when they are awake.

  • If a non-kinematic RB don't move for a while (1-2 sec) it fall asleep.

  • If the RB is moved, or hit by another rigidbody it wakes up.

  • kinematic rigidbodies can wake up other non-kinematic rigidbodies in order to have the physics calculated.

  • If you move a normal collider ( without rigidbody ) into a sleeping rigidbody no collisions are detected.

  • Normal(non-convex) MeshColliders can not collide with other MeshColliders.

  • Only convex MeshColliders can collide with other non-convex MeshColliders.

Since you always need a non kinematic rigidbody you should add this one to the moving object. A Rigidbody represents a moving physics object.

Player characters normally are build with primitive colliders. In most cases (like the charactercontroller) it's just a capsule.

If it worked before you may had the collider turned into a convex collider.

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 Recluse · Jun 09, 2011 at 01:53 PM 0
Share

It worked before because I was using a dummy object for the player with a capsule collider. When I put the spaceship model in I replaced the capsule with a mesh collider. I left collisions off for a few days so I could test other stuff and when I turned them back on I'd forgotten about replacing the collider.

I've got it working now with a box collider on the player ship. As the mesh is simple I tried using the mesh collider with convex set on but it still wouldn't detect the scenery... hmmmm

avatar image
0

Answer by Anxo · Jun 09, 2011 at 11:30 AM

No, but here are some pointers to remember.

Its most of the time better to build box colliders to mimic your scene than it is to use mesh colliders. Meshcolliders are very heavy and may have a negative effect on your game's proformance.

Make sure your collider is not inside of another collider, that your collider does not have an ignore physics in the code, that if you have a rigidbody attached to the player, that is is not kinetic, colliders only work with a none kinetic rigidbody.

If all that does not work, I would try to retrace your steps and undo the changes you did to see what the problem was as well as re-importing the mesh.

I hope that helps.

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
0

Answer by Recluse · Jun 09, 2011 at 12:20 PM

Thanks,

I'm using mesh colliders as it's not practical to mimic my scenery with box colliders - the game uses virtually no physics so no worries on performance - runs at constant 40fps.

My player collider is set as a Trigger and I am testing for other objects colliding using OnTriggerEnter.

I simply want to know if the player object bumped into another object - I don't need any physics at all. Do triggers detect if a mesh collider has entered the trigger?

I've double-checked the collision matrix.

I've reimported the meshes and the changes I made really shouldn't have affected collision detection - I simply rotated the original meshes in Blender then reimported them as well as changing from a 1st person viewpoint to a 3rd person viewpoint.

It's odd. A few days ago it was all working fine... I am stumped.

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 Recluse · Jun 09, 2011 at 12:37 PM 0
Share

I thought something might be wrong with the scenery meshes but the player's bullets are registering the scenery and bouncing off it!

Yet the Player ship will not register scenery unless I replace the colliders with a box collider.

Now why is that????

avatar image
0

Answer by Recluse · Jun 09, 2011 at 12:48 PM

Solved it... replaced Ship Mesh collider with Sphere (which I originally used) and it works again.

Mesh Colliders cannot collide with each other.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

how do i correctly use a box collider 1 Answer

how do i correctly use a box collider 0 Answers

Have part of mesh change color 0 Answers

Collision Checking 1 Answer

OnTriggerEnter not recognising collision ?(Solved) 3 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