PDA

View Full Version : Pausing the walkTo action


MissingAFew
06-04-2015, 12:02 PM
Right now I have something like:


Walk = vizact.walkTo(self.MoveToLocation, self.Speed, 300, turnInPlace=True)
yield viztask.addAction( self.Avatar.AvatarModel, Walk )


I would like to be able to have the avatar stop moving, then resume moving, under certain circumstances. However I cant figure out a good way to accomplish this. I've tried Walk.actionclass.finished() and Walk.actionclass.pause but they don't seem to work. Nothing in particular in the documentation seems to stand out as an easy way to do this, but I may have missed something or used it incorrectly. If anyone knows a good way to handle it, I'd love some feedback. I would prefer to avoid having to write my own movement class if possible, but I realize this may not be avoidable.

Jeff
06-05-2015, 03:46 PM
Take a look at this (http://forum.worldviz.com/showthread.php?t=4517) thread. The example code posted there may help you.

MissingAFew
06-09-2015, 09:20 AM
Take a look at this (http://forum.worldviz.com/showthread.php?t=4517) thread. The example code posted there may help you.

Thank you Jeff, this looks like what I need. I appreciate the help you give around here. :)

MissingAFew
06-11-2015, 11:39 AM
Take a look at this (http://forum.worldviz.com/showthread.php?t=4517) thread. The example code posted there may help you.

I could be wrong but this seems to be checking if the movement has ended. I want it to end abruptly, before it reaches the destination. The way I have it set up right now is that the task is scheduled using the viztask.schedule(). So I think I need to kill the task, and kill the schedule.

I'm gonna look through the documentation a little more, but if you know off hand how to do this it'd be a big help.

MissingAFew
06-11-2015, 11:44 AM
Yeah, task.kill() doesn't actually stop the movement from occurring. Avatar continues to move, despite the task supposedly being killed.

Does this mean I have to manually move the avatar myself instead of using moveTo? Or is there a way to interrupt moveTo and stop the avatar before it reaches its destination?

MissingAFew
06-11-2015, 11:56 AM
Nevermind! clearActions() from the thread you linked to works.