How to move object based on rotation another

I’ve got an issue in my VR project. I’m trying to move one object based on rotation of another one and first one should move only in kind of borders. I’m using a raycast to detect and control these objects. Both should go in x direction.
1 - Object that I rotate
2 - Object that should move
Any tips? Thanks in advance!

5331666--537207--lathe.PNG

With the rotation (Unity - Scripting API: Transform.eulerAngles) of your first object you can apply a movement (Unity - Scripting API: Transform.Translate) to your second object.

1 Like