Notifications
Clear all

[Closed] Probably a really simple question

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. ^^;

3 Replies

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

The only prob i see with your conditonal statement is that you must put “==”.
See.


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

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.