View Single Post
  #3  
Old 04-20-2016, 01:39 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,466
You could use a viztask function to wait for one event and then another before an action is triggered. The following code shows this with key events:

Code:
import viz
import viztask
import vizact

viz.go()

piazza = viz.addChild('piazza.osgb')

avatar = viz.addAvatar('vcc_male2.cfg',pos=[-3,0,5])
avatar.state(1)
walk = vizact.walkTo([3,0,5])

viz.move([0,0,-4])

def triggerAction():
	
	yield viztask.waitKeyDown('a')
	yield viztask.waitKeyDown('c')
	avatar.runAction(walk)
	
viztask.schedule( triggerAction() )
Reply With Quote