• 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
1
Question by kidne · Jul 15, 2014 at 07:53 AM · localscale

Scaling Issues

alt text

it's kind of hard to explain so i drew a little picture and now i can explain easier!! so i have a size horizontal slider for a character creation screen,

    sizeValue = (GUI.HorizontalSlider (Rect (90, 130, 100, 30), sizeValue, 0.1, 0.3));


at 0.25 the meerkat sits nicely ontop of the rotatable podium like it's supposed to. BUT make the meerkat any smaller and it slides inside of the podium. make it bigger and it starts to float into space. my variable " sizeValue " controls localScale like this

 gameObject.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f) * sizeValue;

Is there a way to control this and possibly set the new script as a variable that I can use in PlayerPrefs for the rest of the game?

scalehlep.png (11.0 kB)
Comment
Add comment · Show 1
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 Nerevar · Jul 15, 2014 at 09:52 AM 0
Share

Hello,

You need to add an offset for the position of (it might be Y) to sizeValue/2.

  • for the drawing ^^

EDIT: also isn't it the opposit? when it is small it flies and when he is big he is in the podium? if not it is the origin of your model's axes that is misplaced.

1 Reply

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

Answer by vlames · Jul 15, 2014 at 10:03 AM

I think this has something to do with the pivot of the meerkat, you see, the meerkat expands from the pivot point which (I think) is too low, if you made this model yourself, maybe you can place the pivot precisely at the center of its feet.

otherwise you can change the height within the script

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 screenname_taken · Jul 15, 2014 at 10:09 AM 0
Share

Yeah, i also think it's because of the pivot that was imported from the modeling package. It wasn't at the floor, right at the paws. Click on the model and then change the transform widgets to show the pivot point ins$$anonymous$$d world to see where the pivot is. Damn i like the drawing :P I keep thinking the meerkat to run on the spot with the feet dangling :P

avatar image kidne · Jul 15, 2014 at 09:21 PM 0
Share

Yes! I did make the model and I will try to change the transforms on my own to see if it fixes anything! Thanks for your answer

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

clamp limit variables trouble 1 Answer

What is the best way to zoom a map with an orthographic camera? 2 Answers

How to stop scale reducing from reaching Zero (Solved) 1 Answer

Scale objects marginally! 0 Answers

Scale (Transform.localscale) a gameobject based on ARFaceAnchor anchorData 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