WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-19-2016, 12:06 PM
haohaoxuexi1 haohaoxuexi1 is offline
Member
 
Join Date: Sep 2015
Posts: 81
Smile about triggering action

Is that possible to set up something like this:

Firstly I press keyboard "A" after that I press keyboard "C"

Then one action is triggered.

And this two step is in a order, the first one has to be activated first them do the second one, after that the action is triggered.

Is that any sample code for this?
Reply With Quote
  #2  
Old 04-19-2016, 12:31 PM
haohaoxuexi1 haohaoxuexi1 is offline
Member
 
Join Date: Sep 2015
Posts: 81
The input is not constricted to keyboard, also for other input
Reply With Quote
  #3  
Old 04-20-2016, 01:39 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,465
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
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with triggering an action jelly Vizard 0 04-08-2016 07:44 AM
Walking action of avatars SivaKartheek Vizard 3 01-08-2016 09:17 AM
walking action of avatars SivaKartheek Vizard 1 12-14-2015 10:58 PM
vizact move action andreionutz Vizard 13 11-19-2014 02:54 AM
adding more than 1 action for avatar animation slider control yak Vizard 0 07-21-2009 11:22 AM


All times are GMT -7. The time now is 01:26 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC