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
1
Question by Isan · Oct 09, 2015 at 10:08 AM · texturespritespriterenderer

Sprite Renderer changes visible position on being assigned to a sprite

Hey All,

I already posted this on the unity forums, but realized this may be a better place for this.

I'm currently working on a high score screen for my game and have into a problem I can't quite understand. The system works by taking the player's picture at the start with the kinect camera, saving that as a PNG for later, and then loading that picture and all the others at the high score screen as a texture which is then used to create a sprite and assigned to a sprite renderer.

I have all the elements of the display score (the score, the rank, the background) and the picture grouped under the same object in the hierarchy at the correct ratio I want, however, as soon as I press play, the picture element (and only the picture element) jumps up to the left a few coordinates. The displayed picture itself and the actual transform object do this same jump. This happens with every single score object I've created, and only to this one object. Even stranger, when I look in the inspector as I edit the scene and after I press play, the position visibly jumps, but in terms of transform coordinates doesn't move at all. The jump also seems to increase with the size of the renderer if it has been changed. The jump does not occur when the picture is never assigned, so it seems that this would be the cause. All the other sprite renderers are also being assigned at runtime, but with static pre-created sprites.

I've tried creating the sprite differently, set the position of the object and sprite renderer to where they were before, and all combinations of things. To create the sprite, I'm using what I think is a standard rectrangle (0, 0, tex.width, tex.height) and a (0,0) pivot. I've combed my code and for anything that might be offsetting position and found nothing. I'd rather not use a manual calculated offset as I am about to hand it off to the designer I'm working with who will be changing size and might want to change other elements. Any idea why this is happening and how to fix it?

Thanks in advance for your help.

Comment
Add comment · 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 Isan · Oct 12, 2015 at 01:02 PM 0
Share

After a lot of tinkering, it may have something to do with pivot point, but I still haven't solved it. Could it potentially be a problem with pixel vs. world coordinates for the pivot?

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How change sprite animation texture?? 2 Answers

Gui.Box - Sprite 0 Answers

Gui Box - Texture - Spritesheet 0 Answers

Sprite Renderer is wrapping bottom pixel when it shouldn't be 1 Answer

RGB16 Sprites flickers Bug. 2018.1.x 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