View Single Post
# 2 07-02-2020 , 02:57 PM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,518
I'm guessing frame is supposed to be the current frame. If that's the case then querying the currentTime command is what you want to do. Basically, anything within the `` will be evaluated so you can get a usuable value that you can assign to a variable or compare to another value or whatever. And to assign your $newPosn value to the cube's translateY, then you want to use the setAttr command.

float $newPosn;
if (`currentTime -q` == 1){
$newPosn = 0.0;
setAttr pCube1.translateY $newPosn;
$newPosn = $newPosn + 1.0;

- Genny
::|| My CG Blog ||::
::|| My Maya FAQ ||::