Random z location of objects in Geometry Node, and animating Z location if possible

I want to modify the existing YouTube tutorial a little bit. Here is the file I have created following the tutorial: Hexagon array.blend (113.5 KB)

The tutorial uses random Z-axis scaling between 0 and 1, but I want to change it to random Z position of objects between -1 and 1, because Z-axis scaling also scales the bevel. I have tried adding a “vector math” node and tried to add a random vector value like below, but it did not work. What is the correct way?

Also, if possible, I would like to add some simple up/down animation to it by the following rules below. Can something like that achievable without great effort, or should I use script instead?

  • If an object’s Z position is negative at frame 1, decrease the Z by 0.02 per frame.
  • If an object’s Z position is not negative at frame 1, increase the Z by 0.02 per frame.
  • If the Z value reaches -1 or 1, reverse the increment/decrement.

try translate instances node

1 Like