Avatar Duck Animations
I want to translate a duck (an inbuilt avatar) from one position (say A) to another position(say B). At position A, the duck should not have any movements, that is, it is stationary (code: duck.state(0)). when pressing left click, it should move towards position B, but with state(1).
{code:
duckMove=vizact.sequence(vizact.goto(x,y,z))
duck.add(duckMove)
duck.state(1)
}
once we reach position B, the duck should stop moving and should be in state(0).
{code:
def actionEnd(obj,action):
if action==duckMove:
duck.state(0)
viz.callback(viz.ACTION_END_EVENT,actionEnd)
}
but this doesn't seem to work, can you please suggest something, by which I can carry out the specified task.
-Amit
|