Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 RobertKraaijeveld · Nov 18, 2017 at 08:18 PM · meshscaling

Scaling a mesh moves it up and to the right

I am trying to place one normal sized mesh of a country behind one slightly bigger mesh with a different color, so that it appears as if the original country mesh has a colored border.


However, when I try to do scale a copy of the country mesh, it moves up and to the right instead of having its' center remain in place whilst the mesh itself expands.


The end-result (which I just placed this way by hand so its not very accurate) should be something like this: alt text


But this does not happen. Instead when I increase the scale of the red mesh to, say, 1.1 (like it is in the picture), like this (done in the red mesh's gameObject):


>> gameObject.transform.localScale += new Vector3(1.1f, 1.1f, 0);

this is the result:

alt text


The larger outline is a child of the smaller original but the idea is the same.


Could anyone help me with getting the scaling that I am looking for? Or, if this is simply not how scaling works, are there ways of coloring a mesh's border?


Thanks in advance.

wantedresult.png (37.8 kB)
fout.png (73.2 kB)
Comment
Add comment · Show 4
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 SonicScrew12 · Nov 18, 2017 at 09:40 PM 0
Share

Is this a game object or a UI element?

avatar image RobertKraaijeveld · Nov 18, 2017 at 09:46 PM 0
Share

A game object.

avatar image nygren · Nov 19, 2017 at 01:26 AM 0
Share

Are you sure the center is moving? Do the coordinates in the inspector change? The mesh might seem to move up and right if the center of the mesh is in the bottom-left.

Also since you're adding 1.1 to localeScale you're not scaling by 1.1, but by 2.1 - hence why your large country is so much bigger than the smaller. You probably want to do a multiplication rather than an addition.

avatar image DudeBrainz · Nov 19, 2017 at 04:43 AM 0
Share

Your Object origin could be in a wacky place

0 Replies

· Add your reply
  • Sort: 

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

82 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 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 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 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

Texture on Unity Meshes 1 Answer

Resizing a mesh by its bounds instead of down-scaling it from center 0 Answers

ParticleSystem mesh particles scaling differently in (1,1,1) scale between Simulation Space = World or Local 0 Answers

Changing The scale factor of a humanoid has some weird results 0 Answers

How can I make a torus expand but not grow thicker? 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