WazMeister Posted August 2, 2023 Share Posted August 2, 2023 Hi All, I've been reading the forums / searching and the posts relating to this just confuse me more. I've also played around with the FPS Script and some other third person shooting examples but it's left me more confused. Can someone please help me with how (LUA) I would make my character shoot and have a projectile (3d bullet) shoot out at the direction his facing/pointing gun. I'm just stumped and don't know where to even begin. Many Thanks Quote Dream since child of making games! From Game Programming Starter Kit 3.0, Blitz Basic, Map Creation since Duke 3D, Game Maker, Blitz3D (of recent..2023) and many other engines and years..... never really sticking to it with inner struggles that I've had to fight along with pushing to learn and acheive. 40 years old.. came across Leadwerks on Steam... Learning slowly but surely and loving it! Learn with me or just watch me fail! at my random Youtube Channel, as I stream adhoc while learning and using LeadWerks and other game creating tools. https://www.youtube.com/@wazmeister3151/featured Link to comment Share on other sites More sharing options...
Josh Posted August 3, 2023 Share Posted August 3, 2023 There is a weapon script for guns that does this. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
WazMeister Posted August 3, 2023 Author Share Posted August 3, 2023 FPSGun.lua? That's what I've been reading and playing with, just not getting the parts I need to take and understand as it has a lot of other code too.... Examples are great, (wish there were more downloadable templates / game sources to play with.. not much seems to be released for leadwerks to play around with). but as a newbie it can be a struggling in first place knowing what is what, what bits are needed.. eve when changing and playing with the code, it is very difficult. Maybe a bit of insight to this script you ref and the areas of code that are key would help me on the right path.... Quote Dream since child of making games! From Game Programming Starter Kit 3.0, Blitz Basic, Map Creation since Duke 3D, Game Maker, Blitz3D (of recent..2023) and many other engines and years..... never really sticking to it with inner struggles that I've had to fight along with pushing to learn and acheive. 40 years old.. came across Leadwerks on Steam... Learning slowly but surely and loving it! Learn with me or just watch me fail! at my random Youtube Channel, as I stream adhoc while learning and using LeadWerks and other game creating tools. https://www.youtube.com/@wazmeister3151/featured Link to comment Share on other sites More sharing options...
Josh Posted August 3, 2023 Share Posted August 3, 2023 Okay, so if you want to build something up from scratch, you need to break it down into pieces: You click the mouse. A sphere appears (the bullet). The bullet is positioned and rotated to match the orientation of the point on the gun where the bullet exits (the muzzle) The bullet has to be updated each frame to move forward a certain amount. When the bullet hits something it disappears. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
WazMeister Posted August 3, 2023 Author Share Posted August 3, 2023 56 minutes ago, Josh said: Okay, so if you want to build something up from scratch, you need to break it down into pieces: You click the mouse. A sphere appears (the bullet). The bullet is positioned and rotated to match the orientation of the point on the gun where the bullet exits (the muzzle) The bullet has to be updated each frame to move forward a certain amount. When the bullet hits something it disappears. Ha.. It might not be the definitive answer in LUA code but you know what... Sometimes a basic break down like this really tunes in to how I now need to look at it and should be able to achieve on my own. Thanks for that, sometimes a simple process is the answer. I have a habit of over thinking tings and making them far too complicated than what they seem! Quote Dream since child of making games! From Game Programming Starter Kit 3.0, Blitz Basic, Map Creation since Duke 3D, Game Maker, Blitz3D (of recent..2023) and many other engines and years..... never really sticking to it with inner struggles that I've had to fight along with pushing to learn and acheive. 40 years old.. came across Leadwerks on Steam... Learning slowly but surely and loving it! Learn with me or just watch me fail! at my random Youtube Channel, as I stream adhoc while learning and using LeadWerks and other game creating tools. https://www.youtube.com/@wazmeister3151/featured 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.