TweenPosition doesn't work anymore in server scripts (it did before)

Is it supposed not to work in regular scripts now? Because of this, half of my game was broken today morning (it’s fixed now). It used to work perfectly in both local and regular scripts. I don’t know if this information will be useful or not, but it doesn’t error, it occurs always when I try to run TweenPosition with a script, and this has started happening after the latest Roblox update (today morning).

2 Likes

TweenPosition is UI-related, and as of thus, you should only use it from a LocalScript.
If I may ask, why do you use that method or even touch UI-specific components from a Script?

You can use RemoteEvents if worst comes, but the server shouldn’t touch the UI unless it’s for some information updating client-side or so (and in that case, it’s done indirectly for persistent data).

Could be that he’s trying to tween something in a billboardgui/surfacegui that is in global space.
Seen quite a few games rely on similar techniques.

2 Likes

When I give a ScreenGUI to a player with a server script, I tween it immediately after placing it in his PlayerGui, using that server script. It used to work without problems before so I’m surprised it doesn’t now.

You should try add a LocalScript inside of the ScreenGui that you are copying - that way the client handles the tweening, and it still works just as well.

@Kensai666 BillboardGuis and SurfaceGuis works best if placed into the player’s PlayerGui and make use of the Adornee property. I don’t see how this is any different, unless you break with the intended use, in which case the UI should only be for displaying information and no user input - but I do see your point (wouldn’t be nice to have 50+ BillboardGuis/SurfaceGuis for random tooltips/other uses in the game), although it doesn’t seem very ideal for organizing server and client seperate responsibilities.

1 Like

Isn’t the whole point of tweening to enable a smooth transition? If you’re doing it from the server then you’re defeating the purpose.

3 Likes

I think people are using it as an automatic replacement for RemoteEvents, if the tween methods replicate initiation rather than every property change. This is bad of course, since the server shouldn’t have direct control of local items like GUI.

2 Likes

I use TweenSize on the server-side for health bar billboards, and since this morning it’s broken. Would you not say this is a valid usecase : ?

1 Like

While it’d look nicer and be more reasonable to have it local, that doesn’t mean there aren’t other ways to do it.

Similar to FilteringEnabled, yes it’s much better to use, yet the majority don’t because it’s easier for them.

Yes. Tween locally using locally known values. GUIs are a client thing – servers have no screen.

An update on this, there is a fix in for this, but I agree with the general sentiment you should not do this. The only advantage to doing this server side is the code is significantly less complex, but you are now replicating a lot more data over the wire for something that could happen locally.

1 Like

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