• 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
Question by IbrahimK · Oct 12, 2015 at 01:06 PM · transformscalescalinglocalscale

Rescaling goes wrong?

Hey folks,

I'm facing a weird problem in Unity. And I'm not sure what I'm doing wrong actually. I have an edge that I rescale based on the two points it should connect. Now my code actually works, but my problem is, that the gameobject becomes a big box instead being a thin rectangle (like an edge should be). Basicly, it scales trough the y-coordinate too, which I'm obviously not doing.

 //the scaling
 this.EdgeTrans.localScale = new Vector3(edgeVec.magnitude, 1, 1);
 
 
  //how my object is transformed
 this.EdgeScale(this.EdgeVec);
 this.EdgeRotation(this.EdgeVec);
 Vector3 edgeTrans = this.StartVec + (this.EdgeVec / 2);
 this.EdgeTrans.position = edgeTrans;


I really dont know, why my gameobject would scale its y-coordinate too. I'm kinda confused. Am I overlooking something? I would appreciate any help, since I'm pretty new to Unity.

Regards,

IbrahimK.

Comment

People who like this

0 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 IbrahimK · Oct 12, 2015 at 01:46 PM 0
Share

I realised, that the y-coordinate isn't rescaled. The rotation causes what I meant. Any idea why this happens?

0 Replies

  • Sort: 

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Player Car Runtime Scaling Issue 0 Answers

How is localScale adjusted when re-parenting transforms? 2 Answers

How to make an object's localscale values grow and shrink within a few seconds? 0 Answers

Attempting to Calculate and Change Scale of Platforms Sets Scale to 0 1 Answer

LocalScale and uv 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