![]() |
|
|
|
#1
|
|||
|
|||
|
You could add the box objects to a list and then do “if info.object in boxList:” to check if a box has been hit.
It looks like you would want to call enable(viz.COLLISION) in your RestoreAvatar() function. |
|
#2
|
|||
|
|||
|
I tried doing that, but unfortunately the enable command comes back too quickly. If I just disable the collisions then it works but if I try to enable them again in RestoreAvatar, then I am still able to get multiple shots on the avatars before they "die". Is there anyway I can delay the enabling of the collisions until they walk out again?
|
|
#3
|
|||
|
|||
|
I see a few solutions. Pick the best for your code structure: 1.) Simply call enable(viz.COLLISION), in whatever code tells the avatar to “walk out again.” 2.) Leave enable(viz.COLLISION) in the RestoreAvatar function and call RestoreAvatar when you want the character to walk out again. 3.) You could delete the object (I assume it is a bullet?) that is intersecting with the character with bullet.remove() in your intersection handling function.
|
|
#4
|
|||
|
|||
|
Worked Great! I used your first suggestion. THANKS A BUNCH!!!
|
|
#5
|
|||
|
|||
|
I have a question that is related to this topic. Each avatar that enters the room is holding one of three objects (a gun, a camera, or a phone). When I define the avatar, I put in a function called getWeapon
Code:
def getWeapon(avatar,number): global link if number == 0: link = viz.add(viz.GROUP) myphone = link.add(objects[0]) myphone.scale(.001,.001,.001) avatar.linkbone(link,'skel_HandR') elif number == 1: link = viz.add(viz.GROUP) myphone = link.add(objects[1]) myphone.scale(.0005,.0005,.0005) myphone.translate(0,-.25,.17) myphone.rotate(180) male.linkbone(link,'skel_Neck') else: link = viz.add(viz.GROUP) myphone = link.add(objects[2]) myphone.scale(.0008,.0008,.0008) myphone.rotate(66.51,151.49,86.01) myphone.translate(-0.02,0.04,0.02) male.linkbone(link,'skel_HandRF') |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|