• 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 tobiasbu · Jun 19, 2015 at 06:32 PM · uibuttonui imagerecttransform

Displaced UI RectTransform collider in some resolutions issue.

Hello.

I'm creating custom UI buttons for my game using UI Images. I'm using C# scripts that provides IPointerHandler to detect when the mouse is over, clicking and exiting. When I builded the game, in some resolutions I have the following problem with the mouse on Rect Transform collision:

Normal Resolution (works perfect):

alt text

Another Resolutions. As you can see below the RectTransform is displaced to left.

alt text

Somehow in some resolutions the RectTransform collision is displaced. I don't know why. Why this happens? How I can solve this problem? I want that RectTransform colliders works perfect in all possible resolutions.

lowres.png (37.0 kB)
normalres.png (37.8 kB)
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 fjlafarga · Aug 19, 2015 at 12:00 PM 0
Share

Same problem but displaced up.

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Zoroastrian · Apr 28, 2017 at 05:52 AM

Maybe I'm too late, but I'll answer it just in case someone else comes to here in need of help:

Here you can read information about how the screens resolutions and the anchors of the UI works.

https://docs.unity3d.com/Manual/HOWTO-UIMultiResolution.html

As an important note, be aware that you probably want to set the anchor and NOT the Pivot. In my case I was making a mobile phone, and the layout joystic was moving strangely. I had to put the Anchor in one corner, and the pivot on the center of the screen, to make it pivot correctly, and not around a point in a corner.

I hope this helps someone ^^

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Converting to "Rect Transform" permanently deleted part of my project 0 Answers

Check if UI element is fully inside another UI element 1 Answer

How do I scale the Xmax value of a RectTransform 3 Answers

Resizing UI Image but with minimum width 2 Answers

Unity UI Button distored 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges