WorldViz User Forum

WorldViz User Forum (
-   Vizard (
-   -   about triggering action (

haohaoxuexi1 04-19-2016 12:06 PM

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?

haohaoxuexi1 04-19-2016 12:31 PM

The input is not constricted to keyboard, also for other input

Jeff 04-20-2016 01:39 AM

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:


import viz
import viztask
import vizact


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

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


def triggerAction():
        yield viztask.waitKeyDown('a')
        yield viztask.waitKeyDown('c')
viztask.schedule( triggerAction() )

All times are GMT -7. The time now is 12:57 AM.

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