Proximity event when avatar enters
Hi I need help trying to figure out how can you tell when an avatar enters a proximity sensor. Once the avatar enters the proximity its health is supposed to deplete. I'm not really sure where to start. Is there a way to tell when a sensor enters another sensor? :confused:
|
Just make your avatar a vizproximity Target ;)
Code:
target = vizproximity.Target(avatar) |
Oh! Wow thanks! I had no idea we could do that!
|
Proximity Sensor Event
So I was trying to incorporate the previous code but I'm stuck. does my sensor and target have to be in the same manager? I'm not really sure what I'm doing wrong but the function never executes. :confused:
Code:
sensor = vizproximity.Sensor(vizproximity.Sphere(15,center = [72,-.57,2]), source = avatar1) |
Quote:
Here's a complete code example: Code:
import viz Created in Vizard 4. |
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?
|
Quote:
Code:
health = 100 |
All times are GMT -7. The time now is 06:30 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC