Shirk Posted February 21, 2014 Share Posted February 21, 2014 Im having a bit of an issue when it comes to trying to figure out how to add a new gun using the fpsweapon script. Ive already made a new script for my gun, but Im really unsure how to actually get a functioning weapon with animations. Around line 58 within my weapon script is this line local tag = self.entity:FindChild("akm") Which seems to be how I load my custom model, but it is offset and Im not sure how to change that either. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 21, 2014 Share Posted February 21, 2014 FindChild don't load the model, it will just seek for some model named "akm" that is already attached to some bone or directly to your character.You must use Load function to load something. Just look at this example where all is procedural code and no animations at all : How make it simple without animations : So you can make it simple :like above : Weapon 1 : Arm model + gun as one FBX model Weapon 2 : Arm model + Rifle as one FBX model And just use code to rotate or turn, move your model to mimik firing and reloading, in example above, when reloading , the model is almost hidden , so you don't see that is no reload animations for the hands. Hope to see as good FPS script in Leadwerks 3. 1 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Shirk Posted February 21, 2014 Author Share Posted February 21, 2014 I figured out after I posted this that FindChild is probably used to tell where the muzzleflash should be on the gun, but my problem still remains as to how to get the gun positioned in front of the camera like the default pistol is. Whenever I load a gun it is always out of sight on my screen, and not directly in front of the camera like I would like it to be. Most games that Ive modded use a bone or camera that the code detects and places that in front of the camera. But Im not seeing anything of the likes here in leadwerks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.