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 rct3fan24 · Feb 07, 2017 at 08:19 AM · positionparentingchild objectparent-child

When I set an object to be the child of another object, the child object does not anchor to the parent's position for about 25 seconds

Basically, I have it set up so when the player collides with a certain object, the object becomes the player object's child and the object is supposed to follow the player around due to the child object's position being anchored to the player's. However, what actually happens is, the object does, in fact, become the player's child, and the object's origin position even becomes the player's position, but it doesn't follow the player. The player moves and the object is left behind, changing the object's position values so it stays in the same spot. After around 25 seconds, the object snaps to the correct position and follows the player like normal. It's very strange, and I don't know why this is happening. Has anyone else experienced this? Does anyone know how to fix it?

I'm sorry if my explanation isn't very good... I'm very confused.

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

1 Reply

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

Answer by jdean300 · Feb 07, 2017 at 08:34 AM

Just a hunch here - are they both rigidbodies? If so, you are either going to need to destroy/deactivate the child's rigidbody or look into using joints. Rigidbodies take control of the GameObject they are attached to, and so the child's rigidbody is taking over and controlling it's location. The delay is probably just an artifact of the rigidbodies conflicting in strange ways.

Comment
Add comment · Show 4 · 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 rct3fan24 · Feb 07, 2017 at 08:36 AM 0
Share

Yeah, that must be it. Could I just deactivate the child's Rigidbody for a second and reactivate it? Or would it have to be deactivated for as long as it's the child of the player?

avatar image jdean300 rct3fan24 · Feb 07, 2017 at 08:39 AM 0
Share

The whole time.

avatar image jdean300 rct3fan24 · Feb 07, 2017 at 08:40 AM 0
Share

I should mention though that there isn't much of a reason to have the child rigidbody active. The childs colliders should automatically start working for the parent's rigidbody. If you do need them both active for some reason: joints. When using joints the objects aren't really in a parent/child relationship.

avatar image rct3fan24 jdean300 · Feb 07, 2017 at 08:42 AM 0
Share

I want the rotational velocity of the child object to be maintained as it becomes the child, but if that's not possible it's okay. I'll look into joints.

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

66 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 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 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 avatar image avatar image avatar image

Related Questions

GameObject with 0,0,0 position not being in the center 5 Answers

Set child position and move parents with 2 Answers

Unity 3D : Objects that were parented under empty object are changing their position after I hit play 0 Answers

Jittery world around stationary character 1 Answer

Transform position only working correctly on one axis? 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