WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   timer (https://forum.worldviz.com/showthread.php?t=617)

paulpars 06-14-2006 09:51 AM

timer
 
I am trying to create something so when the viewpoint enters a hotspot a person appears walking in the world. The problem is that I only want the person to appear for 5 seconds and then disappear again. I make the person show up within a timer function and I can't seem to figure out how to set up some other timer so the person only appears for a certain amount of time...I've tried using a director funciton too but can't seem to get it to work. Does anyone have any ideas?

Gladsomebeast 06-14-2006 10:26 AM

Start another timer in the code that makes the person appear. Start the timer with a unique timer number so you know when this timer ends. When the timer callback function is called with the unique timer number, call visible( viz.OFF ) on the avatar.

Code:

#With the code that starts the avatar
viz.starttimer( HIDE_AVATAR_TIMER, 5 )


#Timer callback
def myTimer( num ):
  if num == HIDE_AVATAR_TIMER:
      avatar.visible( viz.OFF )


paulpars 06-14-2006 02:31 PM

ok i got it figured out..the problem was that i was calling the timer from within another timer which made the person visible and refreshed at a very fast rate. i just created a new function and put it outside the timer and it works now..thanks!


All times are GMT -7. The time now is 07:48 AM.

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