Code:
def toggleLink():
global link
if link:
#If link exits, stop grabbing
link.remove()
link = None
if vizmat.Distance(hand.getPosition(), ball.getPosition()) < .5:
link = viz.grab( hand, ball )
if vizmat.Distance(hand.getPosition(),crank.getPosition()) < .5:
link=viz.grab ( hand, crank)
vizact.onmousedown(' ' ,toggleLink())
i wrote this code for grabbing the first object and then releasing it and then trying to hold the second object..but its not working...paul can u tell me where is the problem?