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 /
  • Help Room /
avatar image
0
Question by lacouf · Oct 27, 2016 at 07:16 PM · transformworldspaceparent and childlocalspace

Don't understand parent vs child transform in world and localspace

I have a cube (cube1) at world 0,0,0 with a scale of .05. I create another cube (cube2) which I place at world 1,0,0 also with a scale of .05. Now if I move cube2 so it becomes a child of cube1, the transform of cube2 in X becomes 19.1544. Should't it still be 1 ? I mean, it is still 1 unit away from it's parent object. What does that 19.1544 means?

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 Dibbie · Oct 27, 2016 at 08:06 PM 0
Share

To my understanding, the child takes the parents local Transform (scale, position, rotation) rather then the worlds, so the "units" are different.

If you were to reset the childs position to 0 0 0, cube2 should be exactly on the same spot as cube1, and 1 0 0 , should put cube2 essentially right beside cube1, with absolutely no space in between them, or even possibly be half way outside of cube1, because in the local space of cube1, which cube2 now inherits, 1 0 0 world space, would be the equivalent of almost 19 0 0.

I havnt really dove too deep into all of the technical behind it, and would need Unity opened infront of me (which I do not have right now), but in a simple answer, cube2 is no longer following world space, its cube1's local space.

avatar image lacouf · Oct 27, 2016 at 09:01 PM 0
Share

You are right Dibbie,

I change the scale of cube1 to .01 and cube2 now is 100 units away. It does take the scale in consideration in the transform position of the children.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by hexagonius · Oct 27, 2016 at 08:59 PM

The value of 19.1544 is wrong and should be 2. Since your childed cube 2 is 1 world space unit away from cube 1 but has a scale of .5, that's a distance of 2 (1 / 0.5). Something else must have gone wrong if you get that number.

Comment
Add comment · Show 2 · 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 lacouf · Oct 27, 2016 at 09:07 PM 0
Share

Hello hexagonius,

I have redone it and I do get 20. Scale is .05 not .5

I probably moved my object a tiny, tiny bit to get 19.1544.

avatar image hexagonius lacouf · Oct 28, 2016 at 11:52 PM 0
Share

right, my mistake. still the same reason. since the scale is .05, and the world distance is 1, for the cube it's 1 / 0.05 = 1 / 1/20 = 20

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

83 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 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

Add force forward to a ball using local coordinates doesn't work as I wanted 0 Answers

Does it matter what object's transform the TransformPoint() method is attached to? 0 Answers

Weird Child-Parent behavior 0 Answers

Why does my GameObject move to the side when applying force on the Y axis (in world space) and then rotating it (also in world space)? 0 Answers

how do I rotate an object without affecting later rotation? 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