View Full Version : Probably a really simple question

12-13-2009, 02:42 AM
I'm pretty new at this so this may be completely the wrong way of going about it so sorry. :S

What I'm trying to do is have another object effectively move with another object when a particular checkbox is ticked.

I've wired the object to be "linked" and the object that will be the one it will follow together and in the Y Expression I put

if $testHelper.Grab = true then $Cylinder01.pos = $box01.pos
else $Box01.pos = $Dummy01.pos;

testHelper.Grab being the checkbox, cylinder being the object that should be moving when Box01 does.

Now I was hoping it would work but it doesn't, I presume it's something to do with the way wiring works. Currently it just turns to the checkbox to true whenever I move Box01.

I know it's a question on my first post and I'm sorry for that. But thanks in advance. ^^;

12-13-2009, 08:21 PM
I messed around with it a little more I noticed that it may be the actual line that says " if .Grab = true". So maybe I'm doing something with the if statement, possibly. :S

12-13-2009, 09:10 PM
The only prob i see with your conditonal statement is that you must put "==".

if $testHelper.Grab == true then ($Cylinder01.pos = $box01.pos)
else ($Box01.pos = $Dummy01.pos)

12-14-2009, 12:31 AM
Haha, always the simple stuff. It's definitely got the right idea now even if it still is a bit odd.

When the cylinder is now not being "grabbed" by the box it will move to the position of the dummy, but when the dummy is moved, the cylinder will move exponentially (?). So basically it moves further than the dummy. But partial working is better than nothing. :P

CGTalk Moderation
12-14-2009, 12:31 AM
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.