TweenAnchorPoint

As a Roblox developer, I cannot use Tween to move around elements that rely on AnchorPoint without having to manually script aspects of the behavior to imitate the behavior of AnchorPoint. It is easy to recreate a system that would tween the AnchorPoint from one number to another, but the fact is that it is impossible to use the already existing Tween settings on the AnchorPoint.

If Roblox is able to address this issue, it would improve my development experience because, if I want to use the actual Tween properties, I would have to instead use TweenSizeAndPosition for other GUI elements to reproduce the same effects. However, this renders the purpose of AnchorPoint useless, as this property was created for a reason of making GUI placement easier.

If the goal is to make it easier, it should also retain all of the same features as Size and Position, and this includes the Tween property.

In my case, I created a right-sided sidebar that would tween off and on the screen upon a button click. As per the purpose of AnchorPoint, I set it to (1, 0) with a Position of (1, 0, 0, 0) which made it flush to the very right side. The size of this was (0.2, 0, 1, 0) with a UISizeConstraint of 150 pixels minimum width and 300 pixels maximum. The tricky part here is that the width will not always be at a scale of 0.2 due to the UISizeConstraint, so as of now it is impossible for me to use the Tween API to get it off the screen without (1) manually retrieving the width and (2) updating the position if the size changes.

It is arguable that there are ways around it, but at this point it would be way easier if we can just apply tween properties onto AnchorPoint.

3 Likes

Is there a reason the TweenService isn’t an option in this case? It allows for a more general implementation to tween anything, including the ability to tween multiple things in 1 call, rather than requiring a dedicated function just to tween a single property.

1 Like

Haha yeah I was told that that is a thing! My knowledge of the Roblox API is quite outdated so I had the impression that TweenSize, TweenPosition, and TweenSizeAndPosition is all we had; alas, we can use Tweening for pretty much any number.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.