Avatars in an array and link/unlink
I was wondering if I can get some assistance on this. I created a program that introduces 3 avatars to a user. The user then shoots the avatar by clicking on the avatar that his "holding" a weapon. The 3 avatars can have either a gun in hand, a cell phone in hand or a camera around his/her neck.
Once an avatar is shot, the avatar is supposed to unlink with the object and come back w/ another object. The problem i'm having is that only the last avatar is working. I've tried changing which avatar is last and removing an avatar, leaving only 1 or 2, and what i've noticed is that anytime i remove or change the avatar order, only the last avatar functions correctly. I've gone over the code many times and can't figure out the problem. PLEASE HELP. I've included the relavent parts of the code for your reference. To get the weapons: Code:
def GetWeapon(avatar,number): Code:
for x in range(0,3): Code:
def RemoveAvatar(avatar): Code:
def MoveBullet(bullet,elapsed): |
Still need help
I posted this last week and still have not received a response. Please help. I have to get this done sometime this week and I would appreciate the help. If it would help, I can include the code for the entire program.
Thank you |
At a quick glance the code looks sound. Can you send as concise a copy as possbile of the simulation that replicates this problem to support@worldviz.com and maybe we can find out what's wrong?
|
Just a guess: Somewhere along the line you are using the same global varable to hold the link/gun/avatar/whatever object. So when you setting up the avatars you are overwriting references to the link/whatever objects you need. Keep these things assoated with the avatars you create.
Code:
#Setting up avatar |
That sounds like that might work, however, I'm having a hard time finding the child object for hand and neck. I know you can't just put hand and neck, but I'm not sure where to find what the actual name of the child objects are. The avatar file is above the 1.0MB limit, therefore I cannot attach it as a reference. I did try to right-click on the the avatar in the resources window, but no properties came up.
|
There should be a plus icon next to the avatar in the resources window. Expand that to show bones icon which then has a list of avatar bones
|
I did that. For this avatar, the hand is named skel_HandRF (for right hand finger). I used the following code. I received the following errors:
** ERROR: Could not find child with name 'skel_HandRF' ** ERROR: Could not find child with name 'skel_HandRF' ** ERROR: Could not find child with name 'skel_Neck' Code:
for x in range(0,3): |
To get a bone, use the
|
All times are GMT -7. The time now is 07:17 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC