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 /
  • Help Room /
avatar image
0
Question by MonteyMontey · Apr 30, 2017 at 06:01 PM · c#2dinspectorcoordinates

Resizing Sprites

Okay, I'm relatively new to unity and I'm trying to create a basic 2D jump and run game, but I encountered a little problem, that I don't understand.
If I resize my sprites in the scence view by simply stretching them per mouse, their size change on the scene view as expected, but the inspector values don't.
So for example if I resize my ground sprite, the Box Collider still has the same values as before. This leads to some positioning probelms for me, as I try to position things accordingly to their size shown in the inspector.
Would be cool if somebody could explain this behaviour to me :)

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by ronanskie · May 01, 2017 at 01:59 PM

You should use the scale values in the transform component of the sprite instead of stretching the size per mouse. If you change the scale values of the sprite, the size of the box collider should just increase or decrease with it. This at least works with 3d games, I'm not completely sure if it's the same for 2d games. You can also change the box colliders size manually in the box collider component without changing the size of the sprite.

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 MonteyMontey · May 04, 2017 at 12:50 AM 0
Share

mhh strange, tried it with the scale values but the box collider however still keeps the same values

avatar image ronanskie MonteyMontey · May 04, 2017 at 10:49 AM 0
Share

this is indeed strange. I just tried the same in 2D and the box colliders size changes with the scale values of the sprite just like in 3D. Which version of unity are you using? It might depend on that.

avatar image MonteyMontey ronanskie · May 04, 2017 at 04:37 PM 0
Share

I'm using Unity 5.6.0f3

Show more comments

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

Getting an object two move between two objects continuously 1 Answer

Select only one Layer in the inspector,Select only one layer in the inspector 1 Answer

Checking if the player jumps while not grounded 0 Answers

How do I move a game object only on the x axis with arrow keys? 1 Answer

Having UI follow player 2D C# 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