Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Apr 08 at 10:50 PM by SKY3E for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by SKY3E · Apr 05 at 10:02 PM · uiimagenot workingappeartextbox

Text box and Image not appearing?

The text box and image i added thru the UI options in the hierarchy menu appear in the scene view but when I start the game and it switches to game view the text box and image box arent there. Im using them to display score and have tried changing their size, what could be causing this issue? And how can I fix it?

Comment
Add comment · Show 7
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 jackmw94 · Apr 07 at 11:21 AM 0
Share

What is the "Render Mode" set to on the Canvas?

avatar image jackmw94 jackmw94 · Apr 07 at 11:39 PM 1
Share

@SKY3E can you post a picture of your canvas and it’s transform? I’m betting that it’s screen space UI which is rendered differently to world space UI - it doesn’t have to be in front of the camera as it operates in screen space. It’s a little silly that unity show it in the 3D scene view at all tbh. Can confirm or deny this with information about the canvas and it’s transform. :)

avatar image SKY3E jackmw94 · Apr 08 at 10:49 PM 0
Share

Thank you, it worked!

Show more comments
avatar image SKY3E · Apr 08 at 11:06 PM 0
Share

For anyone wondering how I fixed it, in inspector, after clicking on canvas in Hierarchy, there is a setting called render mode. I used to have it set to "Screen Space - Overlay". I just changed that setting to "Screen Space - Camera" and it fixed my issue. Thanks to everyone who helped me fix my issue!

avatar image jackmw94 SKY3E · Apr 09 at 12:33 AM 0
Share

Might be worth noting that having your canvas as screen space overlay isn’t necessarily a problem or a bad thing, just that using camera space instead defaulted your content to a position that was in front of your camera. Glad it works now though! If you ever find that real world objects clip your UI then screen space overlay might be worth another look but I’m sure it’s fine for now :)

Here are the unity docs for reference: https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/UICanvas.html

1 Reply

  • Sort: 
avatar image
0

Answer by Hawaii_Dev · Apr 07 at 11:50 AM

@SKY3E make sure that they don't get reset to "" in the text and null in the image when the game starts by the code controlling the score counter. Otherwise it might be a issue with the camera not rendering UI layers. Could you share the code that changes the score.

Comment
Add comment · Show 3 · 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 SKY3E · Apr 07 at 10:05 PM 0
Share

@Hawaii_Dev Here is my code :

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;

public class ScoreScript : MonoBehaviour {

 public Text scoreText;
 public float scoreAmount;
 public float scoreIncrease;

 // Start is called before the first frame update
 void Start()
 {

 }

 // Update is called once per frame
 void Update()
 {
     scoreText.text = "Score: " + (int)scoreAmount;
     scoreAmount += scoreIncrease * Time.deltaTime;
 }

}

I dont think my code is the issue but it could be.

avatar image SKY3E · Apr 07 at 10:07 PM 0
Share

@Hawaii_Dev And btw, my image is just an image Ui with an edited color in unity, so nothing that i change through my code and it still doesnt appear.

avatar image SKY3E · Apr 08 at 10:49 PM 0
Share

Thanks for the help, i found the answer!

Follow this Question

Answers Answers and Comments

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

Unity 2019 Everything in Canvas goes Invinsible, wont come back. 0 Answers

compress photos on import 0 Answers

Add smooth parts to UI.Image 1 Answer

How do I save masked user entered image? 0 Answers

UI.Image Pixels Per Unit Multiplier doesn't update via code 2 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