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 Katahiko · Feb 27, 2018 at 09:26 AM · 2dsprite

Sprite not showing up (Tried common mistakes, Z-line, size, place, etc),Sprite is not showing up in 2D ( checked on Z, Layer order, size of the sprite)

Hi, I'm new to Unity. I have been using a code below, and it's been working fine, but somehow it's not showing up on Unity.

 SpriteRenderer Skill_Explain;
 
     void Update ()
     {
         
             Skill_Explain = GetComponent<SpriteRenderer> ();
             GetComponent<SpriteRenderer> ().sprite = SkillSprite;
             Skill_Explain.enabled = true;
         
             Debug.Log ("Skill Sprite is on");
             return;    
         }
     }

I have other scenes that have the same codes and sprite render, and working smoothly. It's not null reference problem, Unity is recognizing it. I checked on scene while debugging, it's not on the canvas at all.

And I have checked common mistakes, such as Z-line, size of objects, layer order, and place of the object.

The difference between the fine one and the problem one is:

1:Fine one have only one sprite render in the scene, and the problem one have two one is working and the other one is not even showing up. (Two game objects with sprite render is not parent/child.) 2: The wrong game object had text component as well (Although, I tried to make them separate objects. Still not working.)

Any advice would be delightful.

,Hi, I'm new to Unity and the world of coding.

I tried to put a sprite with sprite-render on a game object.

         SpriteRenderer Skill_Explain;
 
 void Update ()
     {
         
         if (SkillBool == true) {
             Skill_Explain = GetComponent<SpriteRenderer> ();
             GetComponent<SpriteRenderer> ().sprite =SkillSprite;
             Skill_Explain.enabled = true;
         
             Debug.Log ("Skill Sprite is on");
             return;    

I didn't have any problem with this code before, and I checked objects several times including common mistakes, such as Z line, size of the object or sprite, and place of the object.

It's not Null reference problem, Unity is recognizing the sprite, but it's not visible, I checked on the scene while debug play, it's not visible at all.

Difference between a fine scene and this one would be...

1:The fine one has only one sprite render object, and the problem one has two objects with sprite render; one is working smoothly, and the other object doesn't. (Those objects are not parent/child relation, it's on the same canvas though.)

2: The problem object had a text and button. (Although, I already tried to make them separately, it didn't work.)

Any advice would be delightful.

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 Katahiko · Feb 27, 2018 at 09:27 AM 0
Share

Sorry, Somehow duplicated the question...

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

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

Background in 2D game: sprite or image? 0 Answers

How to make headlight effects on a sprite? (Increasing emission of sprite material) 0 Answers

Sprites moving (shaking) during animation while they should not 1 Answer

Sprite loses quality when imported into unity. How to fix it? 0 Answers

[SOLVED] Problems creating a Sprite through script 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