WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Vizact.call error (https://forum.worldviz.com/showthread.php?t=2178)

jaylocco 07-23-2009 02:12 AM

Vizact.call error
 
hi,

I got this problem..I kept on getting error with this code

Code:

action = vizact.sequence(vizact.call(Pushed.visible,True),vizact.call(PushedWalkBtn))
vizact.onpick( PushBox, Pushed.runAction, action)

def PushedWalkBtn():
        stopcollide()
        carPAUSEaction()
        inviscar()

and the result says

action = vizact.sequence(vizact.call(Pushed.visible,True),v izact.call(PushedWalkBtn()))
NameError: name 'PushedWalkBtn' is not defined


to what I saw in Vizard help, the syntax should be no problem which is
.call(
func
args
)

May I know what was the problem?

THANKs

farshizzo 07-23-2009 09:49 AM

You are referencing the PushedWalkBtn function before you define it. That is why the error says PushedWalkBtn is not defined.

Just place the function definition above the action definition and it should work:
Code:

def PushedWalkBtn():
        stopcollide()
        carPAUSEaction()
        inviscar()

action = vizact.sequence(vizact.call(Pushed.visible,True),vizact.call(PushedWalkBtn))
vizact.onpick( PushBox, Pushed.runAction, action)


jaylocco 07-23-2009 06:51 PM

hah...silly me...thanks for correcting..;)


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

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