How to move an object in any direction?
I have this connection of nodes:
rectangle ---> translate <---- frame
My rectangle then moves ONLY from the center to the right buttom corner of the screen.
How can I make any object move any direction I want?
- Zwischenablage02.jpg 8.17 KB
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac
Support Staff 1 Posted by john on 24 Apr, 2021 08:45 AM
The translate node moves an object in the direction of an X,Y point. To make the object move 20 units to the right and 50 units up, enter 20,-50.
The frame node produces a single integer. When you feed that integer into the translate node's position port, it uses that integer for both the X and Y values. So when you hit play, it first moves the object 1,1 (1 unit right, 1 unit down), then 2,2, then 3,3, etc. The result is a steady movement to the southeast.
To gain more control you need to set the X and Y values separately. One way to do this is to use the make_point node. This node has two separate ports, one for X and one for Y.
If you hook the frame to X port of the make_point node and leave the Y value at 0, then hook make_point into the translate node, the object will move steadily to the right without changing its vertical position. If you hook frame to the Y port instead, the object will move steadily downward.
There are many other different ways to calculate point values for a translate node. For example, you can:
When you hit play the object will go around and around. You can change the width and height of the ellipse to change the orbital path of your object.
There are many, many other ways to control object movement using the translate node. Please let me know if this answers your question. I encourage you to play and come back with more questions!
2 Posted by RK on 25 Apr, 2021 09:25 AM
Thank you for your comprehensive answer. I'll play around with it!