Page 1 of 1

GUN For FPS Games

Posted: Tue Feb 07, 2006 6:35 pm
by Unforgivable.Course
hi

i want to set a gun to my FirstPersonCamera but i don't know how to do it !!
i used the Position function of the camera but it's nasty because it haven't prepare connection to my camera , please put a code for first person shooter gun in vb.net or anyone . Code & Algorithms Needed . Thanks alot

Posted: Wed Feb 08, 2006 12:55 pm
by rwh7hrh7we
search the forum...

you have to add the node to the camera like this

camera.addchild(weapon)

Posted: Wed Feb 08, 2006 2:25 pm
by Unforgivable.Course
god damn , every body say me that (add child , parent )
do u tested it ??? it don't work . i know that i must use position and rotation but still have problem . the gun is left of the camera and i need it in right of the it . it cann't be with position.x & position.z isn't it ??
help me with your codes . tnx

Posted: Wed Feb 08, 2006 5:56 pm
by rwh7hrh7we
yes i tested it

... read the doc....

make the weapon child and then adjust the position of your gun to the position you want...

Posted: Wed Mar 01, 2006 11:51 pm
by TSM
I can also verfy that was rwh7hrh7we said will work as I have used it several times

Posted: Tue Mar 14, 2006 8:46 am
by RapchikProgrammer
I always used that and am currently developing a game so just used it. It works fine! Just remember that when you attach it to the camera the position of the objective is relative to the camera. If you write (10,15,10) that means (cameraposx + 10, cameraposy + 15, cameraposz + 10).

Now you can simply download this program it teaches several function including the gun question you are asking:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=12031