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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by stage1411 · Mar 08, 2014 at 01:22 AM · collidernameswappingcontactinconsistent

Returned string values of thisCollider.name and otherCollider.name swap

The returned string values of thisCollider.name and otherCollider.name swap with each other in a seemingly random and inconsistent manner.

I have a simple set up. I have a character that consists of a parent GameObject with a rigidbody and a controller script component attached, a child GameObject with a collider component for the feet and a second child GameObject with a collider component for the body. Neither of the children have rigidbody components.

There is a completely separate floor GameObject with a collider component, again this does not have a rigidbody component as it is not necessary.

The parent GameObject is named "Parent"

The child feet GameObject is named "Feet"

The child body GameObject is named "Body"

The completely separate floor GameObject is name "Floor"

The following script is attached to the parent GameObject:

 function OnCollisionEnter(theCollision : Collision)
 {
     Debug.Log("The parent object's name is ... " + gameObject.name);
 
     for (var contact : ContactPoint in theCollision.contacts) 
     {
         Debug.Log("A collider on a child gameobject named" + contact.thisCollider.name + " has hit a collider on a separate, completely non-related gameobject named " + contact.otherCollider.name);
     }
 }

When the character is standing on the floor, jumps into the air and land onto the floor again, sometimes the Debug.Log reports the following:

A collider on a child gameobject named Feet has hit a collider on a separate, completely non-related gameobject named Floor

But sometimes it reports the following:

A collider on a child gameobject named Floor has hit a collider on a separate, completely non-related gameobject named Feet

It seems to swap thisCollider.name and otherCollider.name with each other in a seemingly random and inconsistent manner.

Anyone know what might cause this to happen?

Comment
Add comment · Show 2
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 Nition · Apr 07, 2014 at 10:42 PM 0
Share

One thing I've noticed is that it swaps when re-loading a scene. e.g. I've got a scene where it's always one way around, but if I leave the scene and come back, it's always the other way around.

avatar image Nition · Apr 07, 2014 at 11:37 PM 0
Share

Seems that isn't not just switching scenes. $$anonymous$$ore discussion here: http://forum.unity3d.com/threads/97745-Collision-methods-List-of-contact-points-is-mixed-up-incorrect

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

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

Find nearest contact point inside trigger 2 Answers

How to figure out the contact point of OnTriggerEnter? 1 Answer

Raycasts ignoring colliders based on Collider Name 2 Answers

How to Image Swap on Collision 1 Answer

object name disappearing!! 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