• 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
1
Question by snuffysam · May 12, 2015 at 10:50 AM · parentchild

Child skews when parenting

Here's my player and the hammer I modeled: alt text

And here's what happens when I parent the hammer to the player: alt text

No amount of scaling will fix this, which is to be expected, because the hammer is being skewed, not scaled. So how can I keep this from happening?

screen-shot-2015-05-11-at-55005-pm.png (175.3 kB)
screen-shot-2015-05-11-at-55033-pm.png (206.3 kB)
Comment
Add comment · Show 6
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 Owen-Reynolds · May 12, 2015 at 04:13 PM 0
Share

This is caused by non-uniform scaling on rotated children (so you can read about it.) You can't fix it directly, but you can rearrange things to avoid it.

http://answers.unity3d.com/questions/21702/making-object-a-child-causes-distortionskewing.html has more discussion/answers. I'm sure there are others.

avatar image snuffysam · May 12, 2015 at 04:53 PM 0
Share

I found some similar threads, such as the one you linked to, but all of them refer to parenting DURING the game. I'm parenting the object BEFORE running the game.

avatar image snuffysam · May 12, 2015 at 04:55 PM 0
Share

Given that this is caused by the children being rotated before parenting, I tried setting the rotation to 0, parenting, then rotating again. Same problem.

avatar image FortisVenaliter · May 12, 2015 at 04:57 PM 2
Share

Doesn't matter. The problem is that it's applying it's parent's scale after it does the rotation, and having trouble reconciling the two. In general, it's just a really bad idea to have an object be a child of a non-uniform scaled object.

I would make an empty GameObject that is the parent of both. That way they can have individual scales, but will still follow the same transform.

avatar image snuffysam · May 12, 2015 at 05:09 PM 0
Share

I tried this, but the hammer has its own collision box- meaning that pushing up against a wall separates the two. It also messes up my jumping script.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by AlphaSilverback · Nov 12, 2017 at 04:50 AM

The problem you are having there has to do with the BASE scale of the model and it's vertices. Go back into the modelling program you used to create the hammer and uniform/reset the scale of the object. If you are using 3DS Max, select the object and go to the Utilities tab -> Click 'Reset XForm'. Now you should see a modifier added to the object. Collapse them and the scale of the vertices have now been recalculated to an object of scale (1,1,1) / (100%,100%,100%). When you try to rotate the object next time in Unity around it's pivot, it won't skew.

I hope this helps.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Why does disabling an object eliminate its transform performance cost? 1 Answer

Set parent of an object when they collide? 2 Answers

C# Changing a PARENT object's sprite with OnMouseEnter (on it's child object) 0 Answers

The most resource efficient way to dynamically find specific child in parent? 1 Answer

How to add a texture to all the child game objects under a parent ? 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