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 Aladine · Feb 04, 2014 at 07:33 AM · scaleline

is it possible to scale from one side (not axe) ?

Hello everyone,

when you try to scale an object along the X-axe, it will get bigger from left and the right, is there a way to avoid that ? Why ? am trying to find the easiest way to draw a line (click and drag) and i believe that using a Quad, rotate it toward the mouse and scale it forward is the easiest way to do it, but am facing the dual-side scaling issue, is there a way to fix that ?

thank you and have a great day

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 ahaykal · Feb 04, 2014 at 08:27 AM 0
Share

I think it all depends on the pivot of the object. If the pivot is in the center it will scale from both sides.

avatar image Aladine · Feb 04, 2014 at 09:25 AM 0
Share

is there a way to do that ??

1 Reply

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

Answer by GameVortex · Feb 04, 2014 at 08:27 AM

A usual way of doing this is to move it related to how much it is scaled, so it appears it is only scaling on one axis. But another easy way is to child the object you want to scale to an empty GameObject, offset the quad so the root of the parent is on the side of the quad, and then apply the scale to the parent object instead.

Comment
Add comment · Show 5 · 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 Aladine · Feb 04, 2014 at 09:26 AM 0
Share

i already thought about the moving solution but i didn't really like it, but the parent-child approach seems to be the right call, thank you ^^

avatar image GameVortex · Feb 04, 2014 at 09:31 AM 0
Share

No problem, glad I could help. =)

avatar image Jamora · Feb 04, 2014 at 09:37 AM 0
Share

If you're drawing a line, there is the possibility of using a LineRenderer. No scaling issues this way.

avatar image Aladine · Feb 04, 2014 at 09:40 AM 0
Share

@Jamora my "learning game of the week" Dots and i think scaling a quad will be less consu$$anonymous$$g (and easier to do) than LineRenderer, but i'll give it a try though :=)

avatar image Owen-Reynolds · Feb 04, 2014 at 01:56 PM 0
Share

For what it's worth, both methods -- "hand-move during scale" and "child so pivot is at one edge" -- work out to exactly the same math. When you scale an object with children, it scales the child's local coords and moves the child that much. The only difference is that Unity does the movement math for you.

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

Scaling in the forward direction not working. 2 Answers

Dynamic line-drawing between objects (nGUI) 1 Answer

change the length of the vector 1 Answer

unity interactive cloth but keep the original scale of the object 0 Answers

Why does my animation warp when I adjust the scale in Unity? 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