Angelwolf Posted February 20, 2016 Share Posted February 20, 2016 Hello Everyone! So I'm looking to make a gun from scratch. From what I'm aware, these are the steps: Make a model, export as FBX Add to Leadwerks scene Add empty box as child to model within Leadwerks Add Gun script to model Save as prefab Set prefab to player start weapon However, I have tried this and I can't get it working. Is there a guide or tutorial on this? Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) Link to comment Share on other sites More sharing options...
cassius Posted February 21, 2016 Share Posted February 21, 2016 What part is not working? The modeling or the scripting? What is empty box for? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Angelwolf Posted February 21, 2016 Author Share Posted February 21, 2016 If I add my model, add the gun script, save as prefab and try to use as a weapon, it doesn't show on the FPS player when in game. I though the empty box was required as I'd read this on forums before. Essentially to act as a bone, or linking point (apparently). Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) Link to comment Share on other sites More sharing options...
drarem Posted February 22, 2016 Share Posted February 22, 2016 It took me a bit, remember to add a pivot to the end of the barrel named 'pivot'. Look at the example pistol that comes with leadwerks. Then it's on to adjustment hell as you try to align the gun with your view perfectly, save as prefab, remove your extra gun in the scene so it doesn't crash and make sure your gun prefab is attached to your model. Something like that. 1 Quote Link to comment Share on other sites More sharing options...
Angelwolf Posted February 22, 2016 Author Share Posted February 22, 2016 Okay, so here's where I'm at with this. I have loaded the model. I have added the FPS gun script and tweaked the offset and rotation to have it match my player. I have added a pivot to the end of the barrell called 'muzzle'. The gun now loads, is in view, and can shoot (Hooray!) However, I have one final problem now. I can't seem to reload it. Given I am simply using a model for this with no animations, I am assuming that it's mandatory to use a reload animation with it? Any way to bypass this? E; Turns out I was right, it needs to have a reload animation. I have one in Blender but can't work out how to export it properly. When the model is imported into Leadwerks, it sees that there are keyframes but the model doesn't actually animate. I'm sure it's a problem with Blender not exporting properly but God only knows what settings are actually needed there. Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) Link to comment Share on other sites More sharing options...
cassius Posted February 22, 2016 Share Posted February 22, 2016 have you remembered to use animation shaders? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Angelwolf Posted February 22, 2016 Author Share Posted February 22, 2016 Im not even sure what that is, or how to export them (they're exported, right?). How can I use animation shaders? Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) Link to comment Share on other sites More sharing options...
cassius Posted February 22, 2016 Share Posted February 22, 2016 Animation shaders are supplied.Click on the animated models material and in the material editor and look in shaders folder for animation shader. 1 Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 22, 2016 Share Posted February 22, 2016 http://www.leadwerks.com/werkspace/page/tutorials/_/models-and-animation-r8#section7 Quote Link to comment Share on other sites More sharing options...
Angelwolf Posted February 24, 2016 Author Share Posted February 24, 2016 Animation shaders are supplied.Click on the animated models material and in the material editor and look in shaders folder for animation shader. Thank you! Turns out that this, combined with the animations themselves, were the problem. For anyone trying to export their model from Blender, you need to go to the Dope Sheet, set to Action Manager then add a new animation, click the 'F', make your animation with keyframes, then export. You also need at least one bone armature. When exported, the material must be applied with the before mentioned animation shader. Maybe Ill do a video tutorial on this one day when Ive got the knack of it, to help out others. 1 Quote My Games: Nightmare Prism:::WolfTale:::Dungeon Creeper:::Despair of Ordinary Men:::Piano Simulator 2016:::House (W.I.P) 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.