PDA

View Full Version : How to move objects using variables? (Max 8)


Goig!
06-06-2006, 03:41 AM
This is the problem I have, I want to make a Custom Attribute slider that moves one object 1 unit distance along local axis X and another object the same distance in the opposite direction. Basically the objects would swap positions.
By the way, a complication may arise from the fact that the second object itīs parented to the first object.

Now Iīve been squeezing my brain and I havenīt found how to make this, apparently simple thing. Itīs not that I canīt come up with the logical steps for it:

Slider with a value from 0 to 1, create a variable with the input from this slider, letīs call this variable "Bob"
The X position of the first object should be "X position + Bob"
The X Position of the second object should be "X position - 2*Bob" (since this object is a child of the first as the parent moves one unit it has to move back 2 units to end up in the original position of the first object... clear, no?

Quite simple, but I canīt figure out how to get it done. Any ideas?

_stev_
06-09-2006, 07:38 AM
You could use wire parameters. For this we'll say use Point1, Point2, and Slider. Point1 is the parent of Point2. Wire Slider value to Point1 X_Position with default expression of "value". Then wire Slider value to Point2 X_Position using the expression "-(value * 2)+1".

Make sense?

Stev

Goig!
06-09-2006, 02:33 PM
You could use wire parameters. For this we'll say use Point1, Point2, and Slider. Point1 is the parent of Point2. Wire Slider value to Point1 X_Position with default expression of "value". Then wire Slider value to Point2 X_Position using the expression "-(value * 2)+1".

Make sense?

Stev

*scratches head*

Iīll try that later, Iīm fuzzy about this part: "Wire Slider value to Point1 X_Position with default expression of "value""... "value" is the name of the slider... value, right?, not a defined variable.

*scratches head again*

I shouldnīt post inmediately after I wake up. :blush: (misc.php?do=getsmilies&wysiwyg=1&forumid=0#)

CGTalk Moderation
06-09-2006, 02:33 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.