WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 05-23-2006, 11:02 AM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
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?
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:00 AM.


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