change object properties depending on his moving
First of all I want to apologize for my english, i'm not a native speaker.
I just started to learn maxscript and trying to do simplest things. Thing like that:
I have to objects (for example, sphere and a box). Sphere must change it's radius depending on it's position: if sphere.pos.x < box.pos.x, sphere radius must be equal 5. If sphere.pos.x > box.pos.x, sphere radius must be equal 10. This changes must be displayed in viewport while I move sphere or box in realtime.
Here my script at this moment:
clearlistener() max select All max delete a = Sphere radius:7 b = box length:5 height:5 width:5 pos: [-10, 10, 0] select a !REG3XP1!> if a.pos.x < b.pos.x then ( a.radius = 5.0 ) else ( a.radius = 10.0 ) select a
When I move objects, nothing happened. Tell me, please, what I missed? How code must execute conditional test when object moves?