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 Avash · Feb 24, 2015 at 10:42 PM · uieditortransformrectpivot

How do I set rect pivot?

Seems like setting it in the sprite import doesn't work and parenting moves parents pivot. ._.

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 DiegoSLTS · Feb 25, 2015 at 12:41 AM

I don't understand what you mean by "rect", but since you used the "ui" tag I guess you're talking about unity's new UI, you added an Image game object on a canvas and set a sprite you imported as the "Source Image" on the Image component of that Image game object. That's what you did?

If that's the case, when you rotate that game object it rotates from the center, not from the pivot.

Well, from all that guessing, if you want to set the pivot you have a "Pivot" property in the Rect Transform of the Image game object. Pivots go from 0 to 1, 0 means left (for x) and bottom (for y), 1 means right or top.

All the other things I could imagine from your message use the pivot selected on the Sprite Editor.

  • Added a Sprite directly as a child of the Canvas and it rotates from the pivot.

  • Added a Sprite on the scene (outside the canvas) and it rotates from the pivot.

Comment
Add comment · Show 2 · 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 Avash · Feb 25, 2015 at 12:46 AM 0
Share

Yes, the first thing. How can I rotate object around a point then?

avatar image DiegoSLTS · Feb 25, 2015 at 07:26 PM 0
Share

I just said that:

Well, from all that guessing, if you want to set the pivot you have a "Pivot" property in the Rect Transform of the Image game object. Pivots go from 0 to 1, 0 means left (for x) and bottom (for y), 1 means right or top.

Any pivot that you set between 0 and 1 will be inside the component, but you can use any other value and the object will rotate around that point.

Note that pivot is used for local rotation, not for global rotation. For global rotation you can try with: http://docs.unity3d.com/ScriptReference/Transform.RotateAround.html

avatar image
1

Answer by JohannChristoph · Apr 01, 2016 at 04:02 AM

I couldn't move around the Pivot of the Rect Transform because it was kind of deactivated (semi transparent). The Pivot Setting in the main Unity Editor UI (in the upper left corner, right to the editor tool bar) has to be set to Pivot (not Center). Then it works.

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

20 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

Related Questions

How to change the Top and Bottom (rect.yMin and yMax) properties of a rectTransform, in a script? 2 Answers

Change size of the new UI rect transform using scripts 0 Answers

UI How to configure Left And Right. 1 Answer

Convert Input.mousePosition to RectTransform pivot position 2 Answers

Way to create/draw a resizable rect/Rect tool through code? 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