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 /
This question was closed Nov 30, 2018 at 04:08 PM by Lord_Grumpledorf for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Lord_Grumpledorf · Nov 28, 2018 at 06:30 PM · spritescalespritesprefabsscenes

Prefab GameObject is rendering(?) at a different scale per scene

I feel like I'm missing something simple but I can't figure out what's going on here. I have a deer sprite that I turned into a prefab and have on both the Main menu and the staging scenes I'm currently using for testing. For some reason a 1 scale on the main menu is roughly half the height of my player while a 1 scale in the staging scene is quite a bit bigger (amplified by the script I have running that slightly randomizes instances sizes, images below). I thought it might be the different camera settings I had as I'm not entirely familiar with how Cinemachine works, but after disabling it for testing I couldn't see any changes. I just want the deer prefab to be the same size in each individual scene. I hope it's something that I just need another set of eyes to take a look at. Image(s):

Basic 1 to 1 scale difference between scenes: alt text

The worst it can be when they're scaled by the script: alt text

As you can see, it goes from being roughly the same height as the player to almost doubling his height (with antlers included...). No idea what's causing it, but any assistance is greatly appreciated!

P.S. please excuse the in progress art and shoddy photoshop stitch of the issue images. Had to get as much info into them as possible so you could see what I was talking about. Also, I know it's not the player sprite because I actually measured it between scenes. Definitely something going on with the deer prefab.

exampleimage.png (68.0 kB)
worseexampleimage.png (91.8 kB)
Comment
Add comment
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

2 Replies

  • Sort: 
avatar image
0
Best Answer

Answer by Lord_Grumpledorf · Nov 30, 2018 at 04:07 PM

Alrighty, looks like I managed to figure it out. Don't have the slightest idea what caused it, and the solution isn't exactly the optimal choice, but here it is. Just delete all instances of the prefab, and then the prefab itself and remake it... Doesn't feel great having to redo the same work, but this was a relatively small prefab so it wasn't too bad. Looks like I'm a relatively singular case here, as I did a lot of googling prior to asking this question and couldn't find anyone else encountering this issue. I'll be closing the question out now, thanks to R4y-GM for assisting!

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
avatar image
1

Answer by R4y-GM · Nov 28, 2018 at 07:04 PM

hmmm there are any scripts or animators?

Comment
Add comment · Show 4 · 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 Lord_Grumpledorf · Nov 28, 2018 at 07:59 PM 0
Share

There is a script and animator, but they are identical on both instances and the script doesn't work on a multiplicative scale (so it doesn't take current 1x scale * 2 or something, it just sets scale manually to 1.5 or whatever it generates). I'll just post the size bit here.

else if (type == "Deer") transform.localScale = new Vector2(rand = Random.Range(1.2f, 1.5f), rand);

avatar image R4y-GM Lord_Grumpledorf · Nov 30, 2018 at 12:45 PM 1
Share

what is doing your transform.localScale can you post a part of your code?

why you are doing a random value between 1.2 and 1.5? transform.localScale = new Vector2(rand = Random.Range(1.2f, 1.5f), rand);

if you want your scale to 1 transform.localScale = new Vector3(1f, 1f, 0f) put this on your start void or update void

avatar image R4yann R4y-GM · Nov 30, 2018 at 01:12 PM 0
Share

Thank you! you saved my day!

Show more comments

Follow this Question

Answers Answers and Comments

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

Skew a sprite at runtime while preserving the pixel shape? 1 Answer

2D sprite wavering 0 Answers

How to fit a background sprite with 4:3 aspect ratio in a 16:9 screen by simply making the extra content of the sprite from the bottom go outside the camera? 2 Answers

Difference between Sprite and Default texture types? 0 Answers

Normalized UV from batched sprite sheet 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