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')
I'm thinking of making the avatar run through the getWeapon function each time they go through RestoreAvatar, however I'm not sure how to get them to "drop" the object they are holding when they get shot. I tried unlink() but I am unsure where and how to use it. Any ideas?