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 DEtH_MoroZ · Aug 18, 2011 at 10:41 AM · transformscaleuvlocalscaletexturing

LocalScale and uv

soooo... i have cube with adjusted uv mapping. I need to scale it by script. I change it by transform.localScale. and then custom mapping goes away.

When i apply scale 1st and then custom uv - no changes, its the same. But if i change scale by inspector, everything work as expected.

i check everything, only one way is to change it by "hands".

question is - how to fix it?\what command i have to use to access scale directly?

edit1: Looks like i found where is problem. When i apply localScale (no matter before or after uv editing) uv coordinates, that read by raycast goes to stock values, but actually texture mapping saved perfectly.

its still issue lol. "How to read "right" uv positions after applying localScale?"

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 Bunny83 · Aug 18, 2011 at 11:07 AM 1
Share

I have no idea what you're talking about. The scaling of the transform only affects the attached renderer and how the mesh is drawn. The UV-map of the mesh isn't changed at all. Every vertex of the mesh have it's UV coordinate and they stay the same, no matter what you do with the transform.

What do you mean by custom uv after you scaled the object? Unity can't edit the unwrap unless you've written an UV editor for Unity.

Please try to explain your problem a bit more in detail and maybe provide a screenshot.

PS. Don't post an answer to provide this information. You should edit your question. Answers have to answer the question. Use a comment if you want to reply to my comment.

avatar image Waz · Aug 18, 2011 at 12:25 PM 0
Share

Yep, a picture would be easier to understand than "goes crazy".

To edit question, click EDIT button below your question.

To format code, select it and click the 191-010 button above where you type your question.

avatar image Bunny83 · Aug 18, 2011 at 01:26 PM 1
Share

Are you sure you use a $$anonymous$$eshCollider? The UV coordinates returned by a Raycast are from the collider you hit, not the mesh. Only a $$anonymous$$eshCollider (with the same mesh) would return the correct UVs.

avatar image DEtH_MoroZ · Aug 18, 2011 at 02:09 PM 0
Share

"Only a $$anonymous$$eshCollider (with the same mesh) would return the correct UVs."

good point, i thought about it while coffee brake.

1 Reply

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

Answer by DEtH_MoroZ · Aug 18, 2011 at 02:29 PM

"Only a MeshCollider (with the same mesh) would return the correct UVs." yes, that was right.

so, if you are manage to mess with custom, runtime generated UVs, and if u want to draw on it - make sure that mesh with new UVs applied to mesh collider, or new UVs will disappear when u will use corresponded gameobject's transform.

tyvm everyone, i really appreciate that.

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

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

Rescaling goes wrong? 0 Answers

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

Warning: "Setting scale failed, ignoring request." ? 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