View Single Post
  #14  
Old 05-15-2009, 11:46 AM
nasr nasr is offline
Member
 
Join Date: Apr 2009
Posts: 27
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?
Reply With Quote