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 mihail5482 · Feb 27, 2015 at 09:05 PM · 2dplatformer

How do I change the scale of only a portion of the object

Need when you press the up and down to change only the body, but to the top and bottom are not resized. Tried fully for all object zoom, but the top and bottom will melt very thick, they do not have to change the scale

Also did so, broke apart and script resizes ... but also did not work, also tried all trom often asked rigidbody and link them join

But also turned out badly

Help me ...... :)

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 maccabbe · Feb 27, 2015 at 09:13 PM 0
Share

Have you tried making it so you press up and down change the scale of the body and the positions of the top and bottom?

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by karljj1 · Feb 27, 2015 at 09:18 PM

You cant solve this by simply scaling everything on one axis. You need to scale the center column only and then shift the top to follow it. I have attached a simple fix. I added an empty gameobject to the bottom of the body to do the scaling and an empty gameobject to the top to act as an anchor point for your top.


karl.zip (38.2 kB)
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 mihail5482 · Feb 27, 2015 at 10:12 PM 0
Share

Please can you explain more

avatar image karljj1 · Feb 27, 2015 at 10:47 PM 1
Share

Did you look at the example code? A pivot at the bottom will grow the body up ins$$anonymous$$d of both up and down. By placing an empty gameobject at the top and parenting it we can get it follow the top of the body as it also scales. This acts as an anchor point which we can attach our top to using a simple script.

avatar image
0

Answer by alok-kr-029 · Mar 03, 2015 at 06:35 AM

Did you tried changing your pivote point . Make it a child of an empty game object and make the pivote point at its corner and try scaling the parent it will scale from one portion .

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

why 2d platformer "Foot effects" is not in Character prefab? 0 Answers

Having trouble moving object in opposite direction of player. 1 Answer

How to check for the ground in Unity 2D for Jumping 1 Answer

Move game object in opposite direction of player in x & y axis? (2D Game) 0 Answers

How do I use RayCast in a 2D Platformer game? 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