Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 RuGu · Jul 10, 2013 at 07:43 PM · cameragraphicsguitexturemaincamera

GUI Texture & Main Camera Issue

I'm very new to unity, so forgive me if I don't describe things perfectly. I have been playing around with unity for a few weeks and was working on a mobile app. I created a title screen, added some buttons, created a background and then added a GUITexture with a .png file. Everything seemed to be working fine, I then tried to do some camera fading with the screenswipe.js and crossfade. I was starting to understand it; however noticed that now my GUITexture wasn't displaying anymore. I figured this was from me playing around with some scripts that i had made, and started to back track to understand how I broke it, i removed almost everything I did however my GUITexture still does not show up at all.

The only thing I have sort of figured out is when I change the object to a different specific layer that I created for the background image, it does display, though it is streteched obscenely.

I have no idea what I did to prevent my main camera from displaying GUITextures, any help would be wonderful.

Thanks!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Graham-Dunnett · Jul 10, 2013 at 08:07 PM

The positioning of GUITextures can be a bit of a nightmare. Think of the screen as being a unit square, so x and y vary from 0..1. The middle of the screen is then 0.5,0.5. The X and Y components of the transform are used to position the GUITexture. Then the X and Y components of the scale are used. I can't readily explain in words what affect they have. An X and Y scale of 1 seems to make the texture fill the screen. I'm 100% sure, if you have added a GUIComponent to your Camera, that its transform is positioning the GUITexture in some weird place. So, to avoid that, just do GameObject->Create Other->GUI Texture. You'll see this game object has a position of (0.5,0.5,0), and a scale of (0,0,1) and the texture appears in the centre of the screen.

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 RuGu · Jul 10, 2013 at 08:24 PM 0
Share

Graham,

Thanks for your response. I think you led me in the correct direction. I ended up remaking the GUI Texture, and fixing the scale like you suggested. I added it to my background layer that I had set up, which has something to do with a culling mask on the main camera and was able to have it show up again.

I probably should make a seperate layer for all Gui Textures so I do not have it happen again.

Thanks!

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

16 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

Related Questions

I'm trying to get a picture in game and display it on a plane 2 Answers

dynamic hole in layer / texture / camera 0 Answers

Image Effect Scripts on a separate object from Camera 1 Answer

Whats wrong with the camera? 0 Answers

ScreenToViewportPoint not precise enough 3 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