# Collision with Geometry Nodes

I wanted that the grass turn in the Z axe to avoid collision with the box when this last moves.

I try several options but I do something wrong and it doesn't work.

My Geometry Nodes

Any idea how to do it?

You approach is wrong. What you get out of the proximity node is a list of distances for each face of the mesh you are trying to rotate. Then you are feeding it to the transform node that wants you to input only one rotation vector (because you are rotating the whole geometry, not separate points). That said, you need to input a single vector value, not a list of them (you can see that there are multiple entries and not a single one by looking for dashed links). You can also see what is required to input by looking for the shapes of input sockets. Circular means single value, Diamond means a list.

For this particular case I dont think you need proximity node at all. You basically just need to create a vector that tells you from which direction the box is nearing your geometry. Rotate this vector 180° along the z-axis at the origin of your geometry and then align the geometry with this new vector.

The result:

• Thanks Jiří for your explanation, I was a bit confused and now I understand better. Anyway, what I need is that the grass turn when the box hits it. In the other cases the grass must not be moved. Commented Apr 12, 2023 at 11:36
• In that case what I provided you is a good starting point. You'll probably want to measure the length of the vector and apply the rotation only when the length is short enough for the box to collide with your geometry. You can also change the 180° to something smaller or even make the angle gradual. I don't think physical collisions are yet implemented in GN so you'll have to make do with this kind of mathematical approach. Commented Apr 12, 2023 at 11:43
• You could also try to do it per Vertex with the proximity node (which would give you more realistic results). In that case instead of transform node you'll need to use set position node and calculate new vectors for each point separately Commented Apr 12, 2023 at 11:45

With Jiří's help I found a way to make it work.

It's not perfect and only works correctly if you move the box in one direction.

The new GN.

Now I just need to fine tune it.

• awesome:) can you close the question? Commented Dec 18, 2023 at 14:20