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 Saryk360 · Apr 28, 2017 at 04:07 PM · unity 5cameraui

UI element attached to Camera Coordinates

Hey everyone,

I'd like to have a statistics panel (just a canvas with text basically) in the top right corner of the screen. I therefore attached a Canvas to the MainCamera, but thing is as you probably know all the rectransform fields are greyed out... Is there a way to give to the canvas a position relative to the center of the camera screen ?

Or maybe is there an entirely better way to do this ?

(Using Unity5.6.0)

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
0
Best Answer

Answer by Saryk360 · Apr 28, 2017 at 04:34 PM

Oh wait I got it, the Canvas is now in the "root" of the hierarchy, but set to "Screen Space - Camera"

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 ADAMN721 · Apr 28, 2017 at 04:14 PM

You shouldn't attach a canvas directly to a camera. This will cause you problems. Unless your game is networked, you can just add a canvas to the scene and it will be seen in front of the camera at all times. Then, just set your anchors for the UI components under the canvas for where you want them on the canvas IE, top right corner.

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 Saryk360 · Apr 28, 2017 at 04:22 PM 0
Share

So I should have the canvas as "Screen Space - Overlay" and it'll always show on top of everything else ? Will it scale it down also, because if I do that the canvas is gigantic...

avatar image ADAMN721 Saryk360 · Apr 28, 2017 at 04:28 PM 0
Share

The canvas will look huge in the scene view but will be normal from the players perspective. Just leave the canvas on it's normal mode(I can't remember what that's called right now but the one above Screen Space - Overlay). Then just view it from your players perspective and set anchors.

avatar image Saryk360 ADAMN721 · Apr 28, 2017 at 04:30 PM 0
Share

It's not showing when I enter play mode... :/ What do you mean by "view it from the player's perspective ?"

Show more comments

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

UI Camera Question 2 Answers

My game screen is getting blue for 1 or 2 seconds when i am requesting and getting response ? 0 Answers

Retain Position and Scale Values of Render Texture Canvas Elements to another Canvas 0 Answers

UI Elements repositioning and resizing when playing game 1 Answer

Weird Rendering Unity5 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