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 centralinfo · Jun 13, 2019 at 11:21 AM · assetbundlespritesspriterendererresources.load

Sprites randomly display as horizontal lines

Hi,


I am having trouble with the display of sprites ( see image attached ). In the script for the game object I change the sprite renderer by assigning a different sprite as the game progresses. The game will run fine but at a random place in the game the sprite will be displayed as per the attached image. If I delete all my sprites and reimport the png's then a different sprite will randomly show up wrong somewhere else in the game. When I look at the image in the editor the original appears fine.



alt text



Example code that assigns the sprite renderer: actorCenter.GetComponent().sprite = gameController.getSprite(CurrentScene.stageCenterPosImageID.ToString());.


If I build the game and run on a device I will see the same problem, game will run fine and then a random sprite will be displayed incorrectly with the horizontal lines.


I should also mention, I have tried loading the sprites from the resources folder and also an asset bundle for IOS format


Very confused any help will be appreciated.


Thanks for your time.

Chris

problemjpg.jpg (150.2 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

· Add your reply
  • Sort: 
avatar image
1

Answer by centralinfo · Jun 23, 2019 at 10:25 PM

Hi,

For anybody that see's this later from google. I found this issue happens when the total size of all assets in either the resources folder or an asset bundle is over 4gb.

While I was testing I did not use any compression for images or the asset bundle resulting in a 5gb bundle file.

As soon as I reduced the resources file size by changing to an asset bundle and optimising sprite compression settings for each platform the issue no longer occurred.

Chris

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
0

Answer by Kennai · Jun 13, 2019 at 12:08 PM

I hope you have something like

 actorCenter.GetComponent<SpriteRenderer>().sprite = gameController.getSprite(CurrentScene.stageCenterPosImageID.ToString());
Comment
Add comment · Show 1 · 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 centralinfo · Jun 14, 2019 at 03:18 AM 0
Share

Hi sorry, my typo when posting, it is currently:

 actorCenter.GetComponent<SpriteRenderer>().sprite = gameController.getSprite(CurrentScene.stageCenterPosImageID.ToString());

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

114 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

Related Questions

Change Sprite Image in Runtime 0 Answers

How to manipulate sprites in 3D space for cockpit 0 Answers

Why is my sprite not the original resolution? 2 Answers

[2D] Sprite size issue (same sprite differente sizes in Tilemap and world),[2D] Issue with Sprite size (same sprite, differentes sizes in Tilemap and in World) 1 Answer

Why sprites are consuming a lot of VRAM ? 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