WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-30-2008, 04:42 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Attached is some code that uses the walkTo command with the vcc_male avatar. This should work with the other complete character avatars. You will have to make sure you have the correct animation ID passed in so the walk or run animation occurs while the avatar moves.

Code:
import viz

viz.go()

male = viz.add('vcc_male.cfg', pos = (0,0,5))
male.state(1)

RandomWalkAction = vizact.walkTo([0,0,vizact.randfloat(5,10)])

#change the walkSpeed to 3 m/s and set the animation to be a run
RandomRunAction = vizact.walkTo([0,0,vizact.randfloat(5,10)], walkSpeed = 3, walkAnim = 11)

vizact.onkeydown(' ',male.addAction,RandomWalkAction)
vizact.onkeydown('r',male.addAction,RandomRunAction)

If this does not answer your question please let me know.
Reply With Quote
Reply


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 12:37 PM.


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