Point moving within certain boundaries

Hello everyone!
I am trying to make a kind of “weaving” by defining a certain motion to a point using iterations (with Anemone). i am defining this motion within the loop but since i want this movement to happen inside a wall i want to also define the boundaries in which it is going to move. i created a small cluster for this bouncing in the box walls, but it doesn’t seem to be the proper one for this case… so i got a little confused…any ideas?

Thank you!

in the definition i included the first vertical movement version and two other versions where i added some random vectors so that the movement can expand more in 3d space…
27_1_weaving_agentsBoundary.gh (47.2 KB)