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
7
Question by jimbobuk · Feb 26, 2010 at 12:47 AM · gameobjectrigidbodycolliderparent

Should i be able to add gameobjects as children to a parent with a rigidbody?

I've come across this in my main project, and have managed to recreate the problem in a small test project that I'm about to send to unity. I'd put it here but there doesn't seem to be away to add attachments (probably for the best).

Anyways, the simple case is basically a dumbell sort of shape made out of a central cube handle, with a sphere on each end. Something that looks a bit like this

0========0

either side of this object i've placed two other objects, both a cube with a sphere on top. So the setup looks a bit like this, I've labeled the parts, 1-5 beneath the diagram

enter code here

o o [ ] 0=========0 [ ] 1 2 3 4 5

These parts are

  • 1,5
    • cube + sphere
    • cube collider
    • rigid body
  • 2
    • spheres positioned to be on the ends of the dumbbell
    • sphere collider, trigger, no rigidbody
    • crucially they're setup in the root of the scene, NOT as children of the dumbbell
  • 3
    • dumbbell cube

I've got 3 scripts in the world.

  • RotateMe
    • added to the dumbell cube (part 3)
    • has a useRigidBody parameter
      • if set creates a kinematic rigid body in the gameobject and uses it to rotate it
      • if not set no rigidbody is created and the gameobject is just rotated via its transform rotation
  • Detect Me
    • added to the detector parts (parts 1 and 5)
    • implements trigger enter and leave
      • on enter and leave it moves the sphere part so you can tell a trigger has entered/left
  • Manager
    • within its start() it adds the two dumbbell ends (parts 2 and 4) into the dumbbell (part 3) as children

This setup allows me to easily turn the dumbell into something that rotates either via the rigidbody or just using the transform.

From this I have discovered that when the rigidbody is used to rotate the dumbbell the sensors on its end do not update properly. They appear where they should be in the 3d view but the sphere colliders themselves don't appear where the actual spheres appear to be. As such the sensors either end have no reaction when the visible spheres pass through them.

However, when the transform is just being used everything lines up.

As an aside if the spheres are in the dumbell hierarchy in the editor then it also works fine.

As such it appears to be that adding the sphere collider children to the parent that has a rigidbody is somehow not working properly. The spheres appear to move as part of the parent but their colliders don't.

Anyone got any thoughts on this?

Cheers

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 Ashkan_gc · May 27, 2010 at 04:29 PM 0
Share

as i know and the documentation said you should be able to make a rigidbody and make many collider/triggers it's children and move them with the rigidbody and detect collisions correctly. it seems that there is a bug or a problem in your setup.

1 Reply

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

Answer by jonas-echterhoff · Jul 15, 2010 at 03:15 PM

While I don't fully understand the setup from your description, there is indeed a bug in Unity 2.6, which affects children of kinematic rigidbodies not properly updating their positions when the rigidbodies move, which will be fixed in 3.0. Have you reported this as a bug with a project folder? If so please let me know the case number, then I can confirm whether the 3.0 fix solves this or not.

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

No one has followed this question yet.

Related Questions

Ignore Collider 0 Answers

Problem colliding with walls 2 Answers

OnTriggerEnter triggers twice when changing the parent of a gameObject inside of a collider. 1 Answer

Reaching a gameobject from its collider 3 Answers

collision.gameObject returning parent. 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