system.gui.moveComponent strangenesses

hello.
currently, we are developing a prototype of our system, and have faced with strangenesses. preview mode working as it should. but after publishing, project behavior totally different. our application simply moves one element to the coords of another element using system.gui.moveComponent. it is not tied to absolute values. here is a sample:

rail_part = root_container.getComponent(name) system.gui.moveComponent(event.source, rail_part.x, rail_part.y)

in preview mode everything is ok, but after publish, element starts to appears in strange places.

what we are doing wrong?

Because of the way the layout system works, you have two options to make this work. The simplest way is to set the layout mode of everything that needs animating to ‘anchored – top/left’. This will ensure that the coordinates you are passing system.gui.moveComponent() (as in component.x and component.y) are the coordinates it wants.

If you need the layout to be relative, you’ll have to pass coordinates to system.gui.moveComponent() in terms of where the destination exists in the designer and everything will get extrapolated out when the client runs. This means using static values for your script. Hope this was helpful, cheers.

Thank you !