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 donskyale_412 · Nov 15, 2011 at 10:32 PM · transformpositionscale

position and scale ratio;

I was doing a program that enables an object to change its size to a certain number so I use transform.localscale.y and at the end of this object connect an object but when I connect the object by changing its position using transform.position.y equal to that of the scale, the does not intersect at any point in space. I think there is a ratio for the two or my program is wrong. May I ask for some suggestions for this.Thanks.

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 syclamoth · Nov 15, 2011 at 10:42 PM 0
Share

transform.position.y is deter$$anonymous$$ed in global space, transform.localScale is local. What exactly are you trying to do here? Are you trying to scale an object, and keep something at its outer edge?

avatar image donskyale_412 · Nov 16, 2011 at 04:29 AM 0
Share

yes, I'm trying to scale an object and attach another object in one of its ends by changing the second's object position.Does that mean to achieve my goal, I must put the position in local space or put the scale into global space?

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Eric5h5 · Nov 16, 2011 at 04:38 AM

A simple way to do this without needing to figure out any math is to create an empty transform, make that a child of the object, and position it at the edge of the object. When the object is scaled, the empty transform child will go with it. So you can use the global position of the empty transform.

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 donskyale_412 · Dec 02, 2011 at 05:38 AM 0
Share

I don't fully understand this. Sorry I'm a new user of this program. I'm actually using two prefabs and I want to scale the first prefab depending on the second prefab and it's clones(by instantiating).

avatar image saporter · Jun 23, 2015 at 02:26 AM 0
Share

Not an answer to what I'm looking for either, but it DOES point me in the right direction on something else. Good idea.

EDIT: Actually, I changed my $$anonymous$$d, it does answer what I'm looking for! I was just trying to figure out the dimensions of a GameObject... so I took your advice plus added another empty GO in the opposite corner. Boom.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

scale a cylinder from one side only 2 Answers

[solved] Get upward orientation of object and add scale value 1 Answer

postion scale and rotation greyed out and not working 1 Answer

GUI item with object position+dimensions 0 Answers

Transform shows local scale instead of just scale 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