WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-21-2015, 12:53 AM
Erikvdb Erikvdb is offline
Member
 
Join Date: May 2013
Posts: 63
Quote:
Originally Posted by sportykourty View Post
Wow thanks! that's really helpful. So if I want the health to continue to drop until I exit the proximity would i just do a While(true) loop?
No, entering and exiting a proximity are two separate events. Use them to toggle a state that you can check for in the general update loop.

Code:
health = 100
healthloss = False

def onEnter(e):
	if e.target == target:
		healthloss = True
		
def onExit(e):
	if e.target == target:
		healthloss = False
		
manager.onEnter(sensor, onEnter)
manager.onExit(sensor, onExit)

# Demo
def update():
	if healthloss:
		health -= 2 * viz.elapsed()
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
Unexpected Avatar lookAt() behavior when using yield statements chris2307 Vizard 2 12-17-2013 02:58 AM
Avatar & Motion Capture Interface Angie Vizard 1 08-05-2010 06:17 PM
Collision of an avatar with a quad Frank Verberne Vizard 8 06-04-2008 09:44 AM
Looking through the eyes of an avatar Frank Verberne Vizard 2 04-01-2008 05:52 AM
How to make avatar's eyes to blink when speaking michelcm3 Vizard 12 01-15-2008 08:48 AM


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


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