hey
now i'm trying to add weapon intro my source code .
i maded a code to see my wapen .
but i add the code and i can see my weapon but not by me .
i 'm trying to make a weapon on my richt side so i can see it .
i add here my code .
but i realy dont know whats wrong in it .
( sorry for my bad english )
Don't drop the weapon mesh, you shouldn't do that unless you've called weapon_mesh->grab() and i doubt you'll want to be doing that yet. You can see in IUnknown in the API a little explanation on when to call drop and when not to i think. basically if your object has been created with a createXXX() function call you DON'T drop it, but if it's been created with an addXXX() function call then you DO drop it.
To solve your problem you just have to use weapon_mesh->setPosition(vector3df(x,y,z))
try small values for each of x y and z until you get the gun placed right, basically trial and error!
grab() does not mean your player will physically grab the weapon. You are also setting the position of the mesh, you must set the position of the node.
Yeah that's my bad about telling you to set the position of the mesh! I wasn't thinking much whilst typing! But yeah you don't want to be calling grab i shouldn't think, there are times when you would want to but this isnt one of them and i guess in time you'll learn when you would need to, generally you just dont need to so just forget about it for now
Are you trying to attach the gun to the player_node or to the camera? (Hint: I told you how to attach it to the player_node, you should be able to figure out, if you wanted to, how to attach it to the camera)
Use the search link on the forums and try searching for "attach and gun and camera."
Last edited by zeno60 on Tue Dec 19, 2006 5:05 pm, edited 1 time in total.
------ Build started: Project: Project1, Configuration: Debug Win32 ------
Compiling...
game.cpp
.\game.cpp(89) : error C2065: 'pManager' : undeclared identifier
.\game.cpp(89) : error C2227: left of '->getDevice' must point to class/struct/union/generic type
type is ''unknown-type''
.\game.cpp(89) : error C2227: left of '->getSceneManager' must point to class/struct/union/generic type
.\game.cpp(89) : error C2227: left of '->getMesh' must point to class/struct/union/generic type
.\game.cpp(90) : error C2227: left of '->getDevice' must point to class/struct/union/generic type
type is ''unknown-type''
.\game.cpp(90) : error C2227: left of '->getSceneManager' must point to class/struct/union/generic type
.\game.cpp(90) : error C2227: left of '->addAnimatedMeshSceneNode' must point to class/struct/union/generic type
.\game.cpp(90) : error C2227: left of '->getSceneManager' must point to class/struct/union/generic type
type is ''unknown-type''
.\game.cpp(90) : error C2227: left of '->getActiveCamera' must point to class/struct/union/generic type
.\game.cpp(93) : error C2227: left of '->getDevice' must point to class/struct/union/generic type
type is ''unknown-type''
.\game.cpp(94) : error C2227: left of '->getVideoDriver' must point to class/struct/union/generic type
.\game.cpp(94) : error C2227: left of '->getTexture' must point to class/struct/union/generic type
.\game.cpp(98) : error C2227: left of '->getSceneManager' must point to class/struct/union/generic type
type is ''unknown-type''
.\game.cpp(98) : error C2227: left of '->getActiveCamera' must point to class/struct/union/generic type
Build log was saved at "file://c:\Documents and Settings\Eigenaar\Bureaublad\Counter strike 9.0 my game\Project1\Debug\BuildLog.htm"
Project1 - 14 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
You cannot copy and paste that code into your own project and expect it to work without knowing what it does, you really need to take some C++ lessons, these are all basic C++ problems you are facing.