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
9
Question by AgeTDev · Aug 27, 2014 at 10:34 AM · user interface4.6beta

Can I access the new Rect Transform Component by code ?

Hello all, I was playing around with the Unity 4.6 Beta, to test out the new UI elements, What I wanted to do is make a menu appear when a button is pressed. I tried to make a smooth Transition of the menu with iTween, but this resulted in strange things, as iTween modifies the normal Transform component. So my question is , is there a way to Access the new Rect Transform by code , so I can make the Transition manually ? or how do you guys animate the UI ?

Thanks alot , T

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 BarryBratser · Sep 23, 2014 at 07:51 PM 0
Share

I'm having the same problem, I can't seem to programmatically move a RectTransform when it's in an Overlay canvas

2 Replies

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

Answer by Kiwasi · Aug 27, 2014 at 11:06 AM

Yes the RectTransform can be accessed by code.

 (RectTransform)transform;
 GetComponent<RectTransform>;

It can also be manipulated using the animation system.

Check out the documentation, beta forums, and learn section for further details

Comment
Add comment · Show 5 · 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 AgeTDev · Aug 27, 2014 at 11:30 AM 0
Share

Hey thank you a lot ! I will try that out! unfortunately, I did not find a documentation , only the Videos,

could you please provide me with a link ?

avatar image Eric5h5 · Aug 27, 2014 at 12:07 PM 0
Share

It's on your computer, in the Unity documentation folder.

avatar image AgeTDev · Aug 27, 2014 at 02:22 PM 0
Share

Oh, lol thank you facepalm Cheers, T

avatar image AgeTDev · Aug 27, 2014 at 04:41 PM 1
Share

Ok I found what i was searching for :

 TheObject.GetComponent<RectTransform>().localposition


BUT I cannot modify the value! I tried it all, assigning a new vector to it, using the Set() method, Setting each axis on its own , nothing works... hów can i modify this value ???:o

avatar image DeityUK · Dec 11, 2014 at 06:05 AM 0
Share

I think you can modify the position value by setting it with a new Vector3

e.g.

TheObject.GetComponent().localposition = new Vector3 (1.0f, 2.0f, 0.0f)

avatar image
4

Answer by xpkoalz · Dec 01, 2014 at 10:36 AM

If your Canvas Render Mode is set at "Screen Space - Camera" or "Screen Space - Overlay", the Rect Transform component will be uneditable.

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Issues with opening 4.6 Beta project in 4.6. 0 Answers

Who i can rotate new UI Image element? 2 Answers

Unity 4.6 Error different layout! 1 Answer

Unity 4.6 Beta Controller Menu Button Movement 0 Answers

How can I make the text prettier in the new GUI system? 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