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 /
This question was closed Mar 08, 2017 at 07:55 PM by JiggleFun for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by JiggleFun · Mar 07, 2017 at 03:40 PM · physicstransformpositionparentchild

Parent transform not following child transform

I do not have much experience with Unity.

I have a parent gameObject A, with a transform component and a script. These parent A has several child gameobjects, each one of them is a cube, composed by a collider, a rigidbody and a joint, which connects them to each other.

I apply forces to the cubes so they reach a specific local position. However the position of the parent gameObject A, in the inspector does not change, even when other objects are throwned at the cubes, moving them to different world positions. But the gizmo in the center of the parent A, in the scene view, clearly moves as the cubes move.

How can I make the position of the parent gameObject A change simultaneously with the movement of the cubes?

First gif shows the behaviour, and it is possible to see that in the editor the position of the parent does not change, however the gizmo changes. The problem here is that the character returns to its original position, when it should return to the original relative position, if the parent position changed correctly.

https://giphy.com/gifs/l0Iy4FCqWReXC47kI

The second gif shows the exact same situation, but initially by moving the parent position, when the dummy returns to the original position, it returns to the position of the parent.

https://giphy.com/gifs/3o7bu4pHjNtwJ0ZYcM

Comment
Add comment · Show 10
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 _Yash_ · Mar 07, 2017 at 06:37 AM 0
Share

in upper left corner, you will see "center" and "local" buttons.
click on "center" and it will change to "pivot".
in center mode, unity shows handle at the center of all children/geometry.
in pivot mode, unity shows handle at the actual position shown in the inspector.

avatar image JiggleFun _Yash_ · Mar 07, 2017 at 11:13 AM 0
Share

Yeah but this really does not change the behaviour.

What I want is to be able to observe differences on the parent transform, but in the inspector that tranform values never change, and that's my problem.

I need the parent transform (x,y,z) values to change simultaneously with the changes of the transforms of the children.

The children position are calculated based on the parent position, since they're local positions, if this parent position never changes, the children will always return to the same global position, and that's not what I intend.

avatar image Glurth · Mar 07, 2017 at 03:50 PM 0
Share

Normally moving a child object should NOT affect the parent object. However you mentioned that you have joints connecting the parent and children, which COULD change this behavior. There are lots of factors that go into defining a joint, perhaps it is misconfigured? Please show us how you have your joints setup.

avatar image JiggleFun Glurth · Mar 07, 2017 at 03:54 PM 0
Share

I don't have any joint connecting the children with the parent. I have joints connecting the children with themselves.

However I already tried to used a fixed joint to connect the parent with a child object, but eventhough the parent changes its position correctly, the rest of the children can no longer reach the desired local positions.

This gif below shows that: https://giphy.com/gifs/l0Iyl4h95EAs$$anonymous$$s5Gw

avatar image Glurth JiggleFun · Mar 07, 2017 at 04:15 PM 0
Share

Ah, that's probably because the function that adds the forces is not expecting the parent object to change position (which in turn changes the positions of the children objects). If this is the case, I'm not sure you'll be able to make this work, without adjusting that add forces routine. (I suspect the add force routine is using the object's "position"[world-space], rather than object's "localPosition"[relative to parent].)

Why do you WANT the parent object position to change? Could you just use the position of say... the torso, for your purposes?

Show more comments

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Separate child rotation 1 Answer

Moving parent to position of child 0 Answers

Problem with making child an object 2 Answers

Make a simple tree 1 Answer

how to stop child object from twitching? 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