FEATURE REQUEST: Be able to set anchors more than 1 and less than 0

Hello.
I know i should post this in the Feedback section, but that page sucks pretty hard, because you cant upload image and i my pages never get any recognition.

So my feedback/feature request is:
Disable anchor clamping.

Why are they clamped from 0 to 1? Can you make it at least an “option” to disable it? It would be very usefull in many scenarios.

Heres an example of why:

Lets say I am working with different screenresolutions and dpi’s and i want to make an animation where a Button will move into the screen, and starting from above the screen by 100% of its pixel height


In my scene, i have a Canvas set to ScreenSpace overlay, and a Button, and i want to animate the button to move into the screen from above.


I start animating it by putting its position 100% above according to its height


Now animate it to its original position.


But now if i make the screens height smaller (dragged the animationwindow upwards to make it smaller), then the start position in the beginning of the animation is not starting from 100% of its height above the screen, and that will of course make a small delay at the beginning when it will start animate into the screen.

If i it was possible to disable the anchors clamp, then you could animate the anchors instead of the offsets, and let the offset always be 0, then the start position in the animation will always be where it should be no matter what screensize you have.

So right now, I simply cant find any solution on how i would be able to make this simple animation happen at this moment and I definitely cant see any drawback by removing this useless clamping restriction.

Do you have a canvas scaler on your root Canvas? The point of this component is to scale your whole canvas so positions stay relative. I am also guessing your working in free aspect. Don’t do that as it shows results that you would never see on a build. Set your aspect ratio to something valid.

Ahh, i didn’t know that, i see i can do that now.
But now the problem is that i cant reuse my animation, because many ui elements have different sizes like this

1917569--123744--Pic1.png
This works well

1917569--123745--Pic2.png
Here, i reuse the same animation on another button that has smaller size.

The way you have setup your anchors, you wouldn’t be able to reuse the animations even if the anchors were not clamped. You can see in your images that the end position you’d want for the anchors are different for the left and right box.

Not saying unclamped anchors couldn’t be useful for other things, but it doesn’t seem like it will help in your speciifc use case.

Oh yes, that was a mistake…
But if i parented it to another object, and set the anchorMin to {0;0}, and max to {1;1}, and offesets to 0, then im able size it any way i want!

However my point about the picture was about the 100% height thing which you are only cabable of achieveving if the clamp can be turned off.

But the ultimate question is why have you implemented the clamp?
Why not make at least an option to disable it?
What is the drawback of it?

kom nu man!! jeg er også dansker

We’ve implemented support for dragging anchors outside of the bounds of the parent rect when holding down Control (or Command on Mac) - the same key that disables snapping.

It may take a few patch releases before the code makes it to a release.

1 Like

thanks!!

Hey, was the feature supposed to be in the new version 4.6.3?
It doesn’t seem to work.

Now Unity 5 has come out. It still cannot drag the anchors out of its parent rect when i hold down the control key.
Can anyone else do it?

There have been some unexpected issues getting our fixes into the recent patch releases.

Currently we’re aiming for getting them included in 4.6.4 patch 1 and in 5.1.

Sorry for the inconvenience.

Just saw your posting randomly, I was just thinking there has not been many uGUI updates for long time - is there a changelog of upcoming updates?. I’m concerned that there many “small” issues with uGUI and Android devices, missing UI etc although these are not major showstoppers they do cause us to waste lot of time debugging.

Does it mean that 5.1 will be released near 4.6.4p1 or Unity 5’s UI will lag in features behind 4.6?

No, not necessarily.

Well we’re talking about fixes and maybe a few improvement; not new “features” as such. But yes, it’s possible in this one instance that 5.x will lag behind 4.x by up to a few months.

By the way can we get to know why dragging Anchors outside the Corners is disabled? I’m so curious about it :smile:

Okay. Keep up the good work :slight_smile: