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
7
Question by easilyBaffled · Sep 12, 2012 at 12:43 AM · rigidbodyontriggerentermonobehaviour

OnTriggerEnter without RigidBody

I am trying to move an object through a trigger, and I can absolutely not use a rigidBody. According to http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnTriggerEnter.html I dont necessarily need a rigidbody it says "rigidbody (or the collider if there is no rigidbody)" but it's not working for me. Does it not work for a Sphere Collider, does that not count?

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

3 Replies

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

Answer by aldonaletto · Sep 12, 2012 at 01:24 AM

Add a rigidbody to the trigger and check its Is Kinematic checkbox: kinematic rigidbodies don't react to collisions nor suffer gravity effects, but enable the trigger to detect any collider.

Comment
Add comment · Show 7 · 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 easilyBaffled · Sep 12, 2012 at 01:37 AM 0
Share

I can't use rigidbodys the ball freaks out. I've been having problems with rigidbodys because one of my objects is a tube I made in maya and it doesn't work well for some reason.

avatar image aldonaletto · Sep 12, 2012 at 03:53 AM 0
Share

That's why you must make it kinematic: a kinematic rigidbody isn't affected by forces, gravity, collisions etc., but makes the trigger detect simple colliders. Try it.

avatar image easilyBaffled · Sep 12, 2012 at 03:55 PM 0
Share

erp, well thats embarrassing, I thought I had tried that already. Well, thank you.

avatar image jjxtra · Aug 30, 2018 at 09:56 PM 0
Share

Why is this necessary to add the rigid body? Anyone from Unity care to chime in?

avatar image luiscmendez jjxtra · Aug 30, 2018 at 10:10 PM 0
Share

Without the rigidbody component collision checks would be happening on every single collider at any given time in a scene. The rigidbody allows collision checks to be limited to only the object that has the component.

For example, if you're only ever checking against collisions (or triggers checks) from the player to objects in the scene, you only ever need to have one rigidbody that does the check at, the player.

avatar image jjxtra luiscmendez · Aug 30, 2018 at 10:35 PM 0
Share

In my case I found I had to add a rigid body to both my capsule collider (the player) and the other collider. The other collider is a small collider that starts off contained entirely in the player capsule collider, but I still want trigger entered call. Without the second rigid body in the smaller collider, on trigger enter was not called. Is it the receiving collider (the one with the script that has on trigger enter) that must always have the rigid body?

Show more comments
avatar image
0

Answer by luiscmendez · Sep 12, 2012 at 12:48 AM

The shape of the collider doesn't matter. What exactly is your issue? Will the object not pass through? If so, then you probably need to check on the "Is Trigger" box on the object that is the trigger in the inspector.

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 easilyBaffled · Sep 12, 2012 at 01:23 AM 0
Share

No the object passes through, and the box is checked, but the function wont trigger.

avatar image
0

Answer by mkgame · Sep 26, 2018 at 06:58 PM

Hi, I have similar issue. Kinematic Rigidbodies are slow in Unity 2017/2018. The bug entry is this one: https://issuetracker.unity3d.com/is...ger-time-on-2017-dot-2-0a4-and-later-versions. Rigidbody with kinematic on setting was very fast in Unity 5, but this has changed in 2017 version. I guess if you get OnTriggerEnter, then you can attach the Rigidbody to the GameObject (to simulate the physic if necessary), if needed. Not sure what the best solution is right now. You can wait for the fix and ignore the performance issue, or change back to Unity 5.6.6f2.

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

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

How do I add a rigidbody in script? 1 Answer

OnTriggerEnter not firing if rigidbody is on its side 0 Answers

How do i make my own On(somethingSomething)() function? 4 Answers

Can't get trigger to work 1 Answer

Problem with OnTriggerEnter not triggering 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