View Single Post
Old 02-25-2016, 04:39 AM
Seadna Seadna is offline
Join Date: Nov 2015
Posts: 40
Question Spawn Avatar in front of User

Hi folks,

I have been trying to spawn an avatar model a few feet in front of the main view. I can get it to spawn at the location of the main view but not in front. I can offset the spawn location but not in relation to the viewpoint. Any help would be much appreciated.

def AddBot():
                x,y,z,d = viz.MainView.getAxisAngle()
                a,b,c = viz.MainView.getPosition()
                modelfile = randint(1,3)
                dudestate = randint(1, 14)
                if modelfile == 1:
                                dude = viz.add('vcc_male.cfg') 
                elif modelfile == 2:
                                dude = viz.add('vcc_male2.cfg') 
                elif modelfile == 3:
                                dude = viz.add('vcc_female.cfg') 
                dude.setPosition(a + 5,b,c, viz.REL_LOCAL)
                ColShape = Cloud.collideMesh()
vizact.onbuttondown(button_addbot, AddBot)
Reply With Quote