WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   character pack and walkto ? (https://forum.worldviz.com/showthread.php?t=1660)

digitaldarklord 09-30-2008 07:11 AM

character pack and walkto ?
 
Greetings

I am missing something here... the walkto command is not compatible with the characters
pack ?

#Create a walk action that will randomly select a location between
(-5,-5) and (5,5)
walkAnim=child.getAnimationID('child_f_high_walk.C AF')
print walkID
child2.state(walkID)

RandomWalkAction = vizact.walkto(vizact.randfloat(-5,5),baseoffset,vizact.randfloat(-5,5))
#Add walk action to avatar when spacebar is pressed
vizact.onkeydown(' ',child.add,RandomWalkAction)

I want something like this

If you hit one of the cursor keys.

From idle position to walking
Follow the terrain
If r pressed make it run
If nothing pressed idle

But we are puzzled :confused: about the walkto command in combination with the character package. With the standard command this is working normal but with the character pack it's not. We do not understand why ?

Could you paste some sample code that works with the character pack ?

Thanks :cool:

Jeff 09-30-2008 04:42 PM

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.


All times are GMT -7. The time now is 04:45 PM.

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