Ok I have this little FPS and you are just a camera. I want to know how to attach a weapon or a child mesh to that camera also how to rotate or cycle through several guns by pressing the 1 key 2 key and so on. Also how to create impact on a enemy mesh and after say 3 shots they die.
Maybe also how to add weapons to enemys.
Also with a Hud I have read the 2d sprite tutorial and have tried to insert a image into my game but failed... I got the image in but then the 3d game was frozenn...
Sorry I know this is a lot to ask I don't really want you to write my code just point me in the right directions maybe some examples. And documentation referances
dejai wrote:Ok I have this little FPS and you are just a camera. I want to know how to attach a weapon or a child mesh to that camera also how to rotate or cycle through several guns by pressing the 1 key 2 key and so on. Also how to create impact on a enemy mesh and after say 3 shots they die.
Maybe also how to add weapons to enemys.
Also with a Hud I have read the 2d sprite tutorial and have tried to insert a image into my game but failed... I got the image in but then the 3d game was frozenn...
Sorry I know this is a lot to ask I don't really want you to write my code just point me in the right directions maybe some examples. And documentation referances
Thanks for all your help
Make a node a child of the camera, with a gun mesh. Stick it a little in front of the camera.
Use setVisible on your weapon nodes to change weapons.
Give your enemy mesh a health variable. Cast a line from the camera and if that line hits your enemy mesh reduce its health. When its health is 0 use some sort of kill function. You can just use setVisible again for a start.
Easiest way would be to include their weapon in the mesh and animate it. Give them some AI to decide when to fire and cast a line and see if it intersects with the player.
Did you draw your scene manager every frame? This should be in your main loop:
Sorry for the double post, but although that code is great for HUDs, it isn't so hot when it comes to adding a 3D gun to the camera...if I'm worng, and I'm just being stupid (likely) please tell me
although that code is great for HUDs, it isn't so hot when it comes to adding a 3D gun to the camera
I'm not sure what you mean. Does the gun not stay fixed in front of the camera? I don't have a gun in my app, but I do have a compass and it stays put.
Of course, you do have more bob's in your moniker, so you have me beat there.
I discovered the confusion. The scene nodes do stay put when using Irrlicht's built-in FPS cam, but when using your own camera, you must do all of the calculations again in your own code.
What I need is a 3D model of a gun which attaches to the camera...I am using the standard Irrlicht camera, but the gun just doesn't go where I need it.
It would help if I had an idea of how much the vector3df translates the model.