An alternative that still does not use physics could look like so:
There’s no other script. The end result will be the same.