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 /
avatar image
0
Question by chartinboy · Apr 21, 2014 at 06:52 PM · transformobjectscaleparentchild

Make gameobject a child without affecting scale?

Hi there,

my question is whether there is some way I have missed of making a gameObject a child of another object without affecting it's local scale?

Example:

Object A has a scale of 1,1,1 and it is not a child of any object.

Object B has a scale of 1,1,0.5.

At runtime, Object A becomes a child of object B. Currently, object z suddenly changes scale along the Z axis to account for the 0.5 of it's parent. Can I avoid this change in any way?

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 Simon-Larsen · Apr 21, 2014 at 07:07 PM 0
Share

http://answers.unity3d.com/questions/583814/how-to-instantiate-gameobject-as-a-child-without-s.html

This question should give you what you need. Just leave out the instatiate part.

avatar image robertbu · Apr 21, 2014 at 07:19 PM 0
Share

If the size of Object B remains constant, consider editing it so that it has a uniform scale of (1,1,1). It can be done in a modeling program or by editor script in Unity.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Ed unity · Apr 21, 2014 at 07:06 PM

The localScale of the object is always relative to the parent game object. When you make an object a child of another, you must adjust the scale of the child object so that it's scale is now relative the the scale of the parent object. For example in your case, Object A's localScale should become (1,1,2) as it is 2 times the size on the z as the scale of the parent object.

http://docs.unity3d.com/Documentation/ScriptReference/Transform-localScale.html

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

22 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

Related Questions

Problem with child and parent. 1 Answer

Object scale/rotation changes when parented to flipped object 0 Answers

Good way to scale parent without scaling children? 1 Answer

Make a simple tree 1 Answer

Having Parent Origin Follow Child Objects 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