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 HeathMick · Dec 06, 2017 at 05:51 AM · unity 5camerabuttoncanvasspriterenderer

I can't see my button in Game View!

So, I'm trying to make a button BE an image, a .png to be exact. I'm placing that on the Canvas Renderer that automatically shows up when you create a button, but the image is not showing up in game view. When I place that image on the button with a Sprite Renderer it shows up in game view but, I don't know that will still be clickable button when it comes to game time.

This button I'm creating is nested at the bottom of the screen and when clicked will spawn a unit on the battlefield. I'm a rookie at Unity so any help would be appreciated!

Thank you in advance.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by NilZee · Jan 06, 2021 at 08:30 AM

It's too late for you. But it was the first result when I googled the issue. So I'm writing this for everyone that has the same issue. Select your canvas, go to the canvas component > Render Mode. Change it to "Screen space - camera" and add your main camera to the section below that. Now try to find your buttons somewhere on the screen (Select the button from the hierarchy and Press F) and even if it didn't work (it will!), go to the game view and play with the scale and position of your button until you can see it. There is also a possibility that the button is in the back layer. You can change the order of let's say your background, when you select it (Sprite renderer > Additional settings > Order in Layer) Hope it helps!

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
0

Answer by Larry-Dietz · Dec 06, 2017 at 06:02 AM

When you create the button component, it has an image already part of the button. Just put whatever PNG file you want into that, and the button should be displaying your image, with the text component overlaying it.

As long as that button is within the viewable range of the camera, I can't think of any reason it wouldn't show up in the game view.

-Larry

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 HeathMick · Dec 06, 2017 at 06:15 AM 0
Share

I assume, being new to this I don't really know but I haven't found to much online. I put the .png in the Canvas Renderer where the default image for a button is held and it switches the button to my .png but it still doesn't show up in game view.

Could it have to do with sorting layers? The only issue is that to my knowledge buttons don't have sorting layers. So, I can't do anything there. I've also changed the Z position as this is a 2D game and that didn't seem to do anything either.

Further speculation would be appreciated! Thank you.

avatar image Larry-Dietz · Dec 06, 2017 at 06:18 AM 0
Share

Can you post a screenshot of your scene view, with the camera selected?

Here is a screenshot from a game I am working on, showing a button. If you look at the inspector window, you see an Image component set to Buttons_45

Buttons_45 is a PNG file in my project. You can see that it is visible in both the Scene and Game view.

alt text

avatar image HeathMick · Dec 06, 2017 at 07:05 AM 0
Share

The first image is the scene view and you see the the tiles with the character faces in them. Next is the game view and those images disappear! Thoughts?

alt text

alt text

screen-shot-2017-12-06-at-125052-am.jpg (475.2 kB)
screen-shot-2017-12-06-at-125117-am.jpg (453.8 kB)
avatar image Larry-Dietz HeathMick · Dec 06, 2017 at 07:21 AM 0
Share

I am sorry to say, that this one has me stumped. Looking at the screenshots, I cannot see any reason that the buttons are not visible in the game view.

I know this is a pain, but if you want to send me a repro project, just a single scene with the canvas and sprites, no code or anything, I would be happy to dig through it an figure out why this is happening.

avatar image
0

Answer by CmdrZin · Jan 06, 2021 at 06:27 AM

Have you tried making the Buttons children of that brown tiled area at the bottom? They may be getting blocked by it during rendering.

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

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

189 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

Related Questions

Change camera fov on canvas button pressed 2 Answers

Canvas is hiding my 3D model, can I place the model in front of the canvas? 1 Answer

How to instantiate a prefab between Canvas and a Button? 0 Answers

Canvas: On hovering over Buttons: Wrong Buttons activated 2 Answers

The camera doesn't match with canvas 1 Answer


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