WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Avatar Regeneration (https://forum.worldviz.com/showthread.php?t=567)

betancourtb82 05-01-2006 11:14 AM

Avatar Regeneration
 
I have a problem with my avatars. What is happening is that I have my avatars walking toward a subject once i hit the 'a' key. I then proceed to shoot them and when the bullet hits them, they fall using the following code:
Code:

        info = viz.intersect(pos,futurePos)
        if info.intersected:
                print 'intersect point is',info.intersectPoint
                if info.object in characters:
                        avatarsHit = avatarsHit + 1
                        #intersectList.append(info.intersectPoint)
                        #intersectList.append(info.intersectPoint)
                        #print 'intersect list is',intersectlist
                        viz.playsound('arrgh.wav')
                        print 'Avatars hit: ', avatarsHit
                        WaitThenFreeze = vizact.sequence( vizact.waittime(info.object.getduration(7)-0.12), vizact.speed_node(0) )
                        info.object.execute(7)
                        info.object.clear(viz.ALL)
                        info.object.clear(viz.CURRENT_ACTION)
                        info.object.add(WaitThenFreeze) #Add the action to the avatar
                        RemoveAvatarAction = vizact.call(RemoveAvatar,info.object)
                        info.object.add(RemoveAvatarAction) #Add action to remove avatar

The RemoveAvatarAction is as follows:
Code:

def RemoveAvatar(avatar):
        avatar.visible(0) #Hide avatar
        #avatar._face_.visible(0) #Hide face
        avatar.speed(1) #Restore speed
        characters.remove(avatar) #Remove from list
        waitlist.append(avatar) #Add to dead list
        waitlist[0].clear(viz.ACTION)
        waitlist[0].clear(viz.CURRENT_ACTION)
        StartAvatar(randint(0,2))

The problem is, once they "come back to life" I am not able to shoot them. The bullet still goes through them, but nothing happens. I'm not sure why. Please help.

Thanks,

farshizzo 05-01-2006 03:34 PM

Hi,

When you start an avatar do you add it back into the characters list?


All times are GMT -7. The time now is 10:25 AM.

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