avatar walkto interrupt
Hello,
This maybeIs there a way to stop an avatar that's walking from point A to point B "dead in it's tracks"? My code untill now looks somewhat like this: Code:
def walk1(): |
In the following example the spacebar is used to start and stop the avatar as he walks between two points:
Code:
import viz |
Thanks for your reply Jeff. I've tried the "clearactions()" statement.
However, since i'm using schedule to arrange the actions, i have to kill that as well to prevent the other walking actions from running. I've tried this: Code:
def walk1(): Code:
def stop(): |
Once the user stops the avatar, what is the next action that should be applied to the avatar? If the avatar stops on the way to PointA, should he pick up from the same place later and continue to PointA, or go to PointB, or should the whole task be ended?
|
Jeff, i'm writing some software for a military simulation, the avatar actually gets shot and killed.
So the whole task should be ended, i would like the avatar to assume a specific state (lie down) and perform no actions anymore after that. |
Not to sound too desperate, but i'm still having some difficulties with this. Does anybody perhaps have a suggestion for me?
|
If you're waiting for either the walk action to finish or the keypress to occur you should use the viztask.waitAny command. Then if the event was a keypress you can leave the task using the return command:
Code:
d = yield viztask.waitAny([waitSpaceBar,waitAction]) |
All times are GMT -7. The time now is 01:50 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC