WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-14-2006, 10:51 AM
paulpars paulpars is offline
Member
 
Join Date: May 2006
Location: Kingston, Ontario
Posts: 14
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?
Reply With Quote
  #2  
Old 06-14-2006, 11:26 AM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
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 )
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
  #3  
Old 06-14-2006, 03:31 PM
paulpars paulpars is offline
Member
 
Join Date: May 2006
Location: Kingston, Ontario
Posts: 14
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!
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


All times are GMT -7. The time now is 02:55 PM.


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