ScriptSpot

Forum topic · General Scripting

script controller

By metro · 2007-08-26

Description

hi

could somebody tell me how can i lock an object's Z position with a script controller attached to the Z Position track in the motion panel?

I want the object not to go below 0.0 in Z. I'm using this:

if ($.pos.z < 0.0) then return 0.0
$.pos.z

it works, but every time a release the object and pickit again to move its jumps to 0.0 in Z. just try it. why is this hapening!??

thanks

Comments (1)

crazyosachou · 2007-10-14

hi,
Just go to : Command Pannel -> Motion
there, select "Posistion --> Z-position
then clikc on "assign controller" (on the small "?" botton just below.then choose "Float Script".
By default z will be equal to 0. (z=0) and it'll be locked.
u can change the value as u want.

Good Luck.