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 Seth-Bergman · Jul 29, 2012 at 07:18 AM · collisiontriggercollidersontrigger

kinematic trigger with static collider-no trigger message?

Hey all, just curious here:

I created a test scene which is basically just a sphere collider with a box that I can move to collide with it, in order to test the various collision combinations as seen in the collision action matrix here:

http://docs.unity3d.com/Documentation/Components/class-BoxCollider.html

I have the sphere set as trigger.

most results have come out as expected, however:

if I add a rigidbody to the sphere(trigger), it still sends a trigger message with the static box collider (as expected)... but if I set the rigidbody to "isKinematic", no trigger message is sent (to either object)

what's really weird is if I add the move script to the sphere as well, so that they both move into each other, they both receive a trigger message! (whether or not the cube still has the move script)

the move script is only this:

 function Update () {
 if(Input.GetKey("w"))
 transform.Translate(Vector3.forward*10 * Time.deltaTime);
 }

but if I turn it back off, no message. I am watching the colliders intersect, so I know they are hitting either way.. So why does adding this script make the trigger work, or rather why won't it work without it?

(instead of this move script to the sphere, I also tried adding a rigidbody to the cube instead, and this makes it work too..)

what am I missing?

EDIT: ok, thought about it for a minute, now I'm guessing the rigidbody may be sleeping, that's why it won't work.. but if that's it, why would changing it from kinematic matter? still don't quite get this, is that what it is? (anyway, according to the script reference, a static collider won't wake a rigidbody, so I'm not so sure)

Comment
Add comment · Show 1
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 Seth-Bergman · Jul 29, 2012 at 09:39 AM 0
Share

on an unrelated note, while playing with this I inadvertently noticed that even when the script is disabled, the Debug log in the OnTriggerEnter function still gets called.. So does OnTriggerEnter run even if the script is turned off? what other monobehaviors would this be true for?

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Temporarily ignore collisions between player and enemies 2 Answers

changing gravity OnTriggerEnter 1 Answer

Trying to make object turn red OnTriggerEnter 0 Answers

get only one colliding body 3 Answers

Speed/trigger only working once 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