Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Dastardly Banana -(Free) FPS Weapons Package UPDATE- 0.95

Discussion in 'Assets and Asset Store' started by Jason_DB, Mar 29, 2010.

  1. Tomme

    Tomme

    Joined:
    Jun 17, 2010
    Posts:
    66
    Very simple, get your model into Unity, then just followed how the other guns attached to the Player prefab are done, in the Weapon Camera section of it, add the same scripts ect, all you will need to do is change the animation script to fit yours and, the properties of the weapon.
     
  2. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    It's the first video tutorial on the site. You don't have to do any coding to add or make weapons, just put in the graphics and set the stats.

    Edit: Thanks Tomme
     
  3. badbii

    badbii

    Joined:
    Dec 6, 2009
    Posts:
    83
    Hi Jason, can you add power bar for sprint event on GUI???
     
  4. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    One tip, adding something to change the mouse sensivity when aiming would be great.

    When using scoped weapons specially, it gets hard to aim properly because of that.

    But it also happens with no scoped weapons.

    :wink:
     
  5. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @coin-god the sensitivity automatically changes when you zoom in, and you can change it if you want (in mouseLook).
     
  6. Ayzhong

    Ayzhong

    Joined:
    Jul 21, 2010
    Posts:
    18
    Hey Dastardly Banana I found the FPS Weapons package on your website and I must say it is awesome! :)

    Just got around to putting it in. Anyways, for some reason, when I attach the Lock Cursor script from the package to my Main Camera, I click the mouse once...and I end up in the middle of nowhere. Like, the whole map is gone and there is nothing.

    I have no idea wats going on. :(

    Thanks
     
  7. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    I can't tell you exactly why, but adding lock cursor to the player or camera does that. Try making a game controller object (just an empty gameobject) to put the lock cursor script on and any other scripts like it.
     
  8. Ayzhong

    Ayzhong

    Joined:
    Jul 21, 2010
    Posts:
    18
    *Facepalm*

    I am such an idiot :D
    I made the empty gameobject for my Main Menu screen but I totally forgot to try that here!

    Thanks a lot man. Your a genius!
     
  9. Johker

    Johker

    Joined:
    Jun 24, 2010
    Posts:
    24
    Hi DB, thank you for the awesome-awesome package.

    Do you have any plans to put the Sustained Weapon configuration video back up on your website? I am trying to create my own Sustained Fire weapon and for some reason the Line Renderer doesn't seem to work on my gun, it is nowhere to be seen.

    Any ideas?
     
  10. chkkll

    chkkll

    Joined:
    Jul 20, 2010
    Posts:
    40
    hi,
    awesome package!:eek: im a noob so dont get irritated by me lol.. im using DBFPS package for my little demo for handling matches, a flashlight and a Colt 1851 Navy Revolver :)
    just got two little problems: first, whenever i try to preview picking up in editor, when the cursor is on the picupAble object it crashes instantly, no problem at the buildied exe though.. secondly, is it possible to disable the pickupAble weapon after the pickup?
    and maybe a third and a fourth thing, is it posibble to add a secondary muzzle (actually i did that with copying another gunscript and attachin another muzzle, but it doesnt feel right), and maybe a particle emitter to simulate smoke comin out of the gun after shooting..
    oh and some more stuff i was thinkin about: im giving player just 5 bullets so after they are fired there will be no more, so can i assign a empty gun sound after bullets depleted when the fire button clicked?
    i use no crosshair, but i try to use it like a pick up symbol whenever the cursor is on the object, is it possible to use a hand icon instead of the crosshair?

    would be glad for any solution..

    cheers
     
  11. chkkll

    chkkll

    Joined:
    Jul 20, 2010
    Posts:
    40
    just fixed the crashing problem. was my bad, used weaponinfo on pickupable object instead of main weapon, that was the proplem..

    i also noticed smthng else, u can not set main cam and weapon cam to different FOVs if u have Aimmode script running, the gun seem not to be behavin..
     
  12. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @ chkkll

    Right now you can't add a second muzzle flash to a weapon (or smoke) without coding. It would be simple coding, though, just tell the smoke/etc to turn on/emit when the muzzle flash is activated.

    You also can't put a "empty gun" noise right now, although I'm working on fixing that and it could be in the next update.

    As far as drawing the hand Icon, you would need a new script (the crosshair script only draws a crosshair). There is a starting point in the crosshair for that, though, you would just need to change it:
    Code (csharp):
    1. function Update(){
    2.     var hit : RaycastHit;
    3.     var direction = transform.TransformDirection(Vector3(0,0,1));
    4.     if(Physics.Raycast(transform.position, direction, hit, crosshairRange)){
    5.         if(hit.collider  hit.transform.gameObject.GetComponent(CrosshairColor) != null){
    6.             var colorScript : CrosshairColor = hit.transform.gameObject.GetComponent(CrosshairColor);
    7.             if(colorScript.crosshairType == crosshairTypes.Friend){
    8.                 ChangeColor("Friend");
    9.             }else if(colorScript.crosshairType == crosshairTypes.Foe){
    10.                 ChangeColor("Foe");
    11.             }else if(colorScript.crosshairType == crosshairTypes.Other){
    12.                 ChangeColor("Other");
    13.             }
    14.         }else{
    15.             ChangeColor(""); //Any string not recognized by ChangeColor is the default color
    16.         }
    17.     }else{
    18.         ChangeColor("");
    19.     }
    20. }
    21.  
    This part could be repurposed, so that whenever something tagged as useable by the player was looked at, an icon appears in the middle of the screen.

    As far as the question about setting the main cam and weapon cam to different FOVs: why do you want to do that? The two cameras should really be thought of a two parts of the same camera, so giving them differing fields of view would just cause issues (also the field of view is overwritten upon entering aim, so it will return to 60 during play).

    @Johker we will record the sustained weapon tutorial soon; we're just hard at work on finishing up another update so we haven't gotten to it yet.
     
  13. chkkll

    chkkll

    Joined:
    Jul 20, 2010
    Posts:
    40
    thanks so much Jason, solved the hand issue by your help after u put it that way it became so simple lol. i created a guitexture object with the hand texture and made it active or inactive within your code. i attached it to crosshair type other, so in my case that means i can use several different textures by using your crosshair types..
    guess i can also solve the muzzle and smoke in a similar way.
    my intention to make a weapon cam and a main cam with different fovs, was to achieve a much more narrow look for the weapon visually. but a gace it up after realizing that the aimmode script controlled them both..
    thanx a billion times.. im very exited about your next update..
    also here are couple of screenshots of the thingy..

    cheers
     

    Attached Files:

  14. chkkll

    chkkll

    Joined:
    Jul 20, 2010
    Posts:
    40
    mm discovered that if i attach hands activation code to crosshair script, it activates even when you are far away, i dont know if there is a more convinient solution for it but i solved it by using the selectable weapon scripts highlight feature, just used the activation code there.. but this way i lose the ability to use different icons for different objects.. im such a noob lol. but in my case it did the job..
     
  15. theLuke

    theLuke

    Joined:
    Jul 25, 2010
    Posts:
    2
    @chkkll The screens look good!

    @Banana are there any graphics things that come with the package?
     
  16. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    It comes with some starter models: some animated weapons and a target.
     
  17. mikevanman

    mikevanman

    Joined:
    Sep 30, 2009
    Posts:
    108
    hi, I just notices some of the new feature on your demo page, lots of fun and cool nice too. I love the crazy gravity gun.

    Are these updates available to purchase or coming in a future update?

    big up again great work
     
  18. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Updates to the base package are free, but the gun models (and special weapons like the gravity gun) will be available for purchase in our store once we finish setting it up (probably within the next week).

    ...Speaking of updates, here are from shots of what I'm working on for the next (free) update which will be done soon.



    /HintAtNewFeatures
     
  19. mikevanman

    mikevanman

    Joined:
    Sep 30, 2009
    Posts:
    108
    looks mint

    I'll be buying as soon as you get your store set up.
     
  20. mikevanman

    mikevanman

    Joined:
    Sep 30, 2009
    Posts:
    108
    actually are their any addons for the weapons package I can purchase at the moment (or are you waiting to get your online store set up)

    I feel a bit like an Apple fanatic camping overnight for the store to open.
     
  21. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    The paid stuff (which right now is I think 18 animated weapons and the code for the gravity/singularity gun) we're waiting to finish the store. It's just about finished though, the biggest job at this point is cataloging the items.

    The free stuff will be out soon, we just need to finish the tutorials and the new demo scene.
     
  22. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    Updates looking great man. Nice work.
     
  23. xToxicInferno

    xToxicInferno

    Joined:
    Jan 31, 2010
    Posts:
    47
    Looks great, i also want to know do you have a pistol model (and animations) for sale (or soon to be)? If so, i will definitely be looking into purchasing the pack from you. Thank you so much for giving away this tutorial for free, it is by far the best free project i have seen.
     
  24. Silver

    Silver

    Joined:
    Nov 8, 2009
    Posts:
    38
    is it possible to replace the weapons models with ones i have already?
     
  25. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    You can use any weapon model you want, with your own animations.
     
  26. I Acid Reflux I

    I Acid Reflux I

    Joined:
    Jul 29, 2010
    Posts:
    9
    Just a suggestion, maybe have Tutorial on replacing the weapon models with your own?? because noobs like me dont know how to do that fully. It would help me out a lot
    :)
     
  27. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    If you watch the first tutorial you will see where the weapons are in the player hierarchy. Once yo find them, just repalce the models with your own.

    Easy as pie. :wink:
     
  28. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    All it needs is one script (gunChildAnimation) and the be a child of the aimobject (I think that's covered in the first tutorial). Then just change the names of the animations in gunChildAnimation to be the names of your animations, and it should work (although you will probably have to move the aimObject to get the gun to look right in FPS view)!
     
  29. Ayzhong

    Ayzhong

    Joined:
    Jul 21, 2010
    Posts:
    18
    Hi and sorry to be bothering you again, but this time I was following the Picking-up weapons tut on your website and i try to follow as best I can, but for some reason it never works. the highlight simply doesn't happen. i looked and it seems like that tutorial was made with an older version of your FPS weapons package, so is there any changes from the version in your tutorial and .92?

    Thanks in Advance!
     
  30. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    There haven't been any changes to the weapon pickup in new versions (I just had to make like 12 pickup-able weapon the other day). The first questions I would ask are whether or not the weapon is tagged correctly, if the pickup distance on the weapon camera is large enough to reach the weapon, and if the scripts "pickup weapon" and "selectable weapon are placed correctly (weapon camera gets pickup weapon, the pickup gets selectable weapon).
     
  31. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    The new 0.95 update is out! We've added melee weapons, support for grenades/bows(due to the new fire delay), ammo sharing between weapons, progressive/shell-by-shell reloading (like for shotguns), Take-Out animations for switching weapons, fire animation scaling to fit fire rate, and improved the ammo display! It's a pretty exciting new update, so I hope everyone i happy with it (also report any bugs in this forum post or through email to info@dastardlybanana.com).

    Here's the link, in case you don't want to go back to the first page to get it (also be sure to watch the new tutorials): www.dastardlybanana.com/FPSConstructorWeapons.htm
     
  32. Tomme

    Tomme

    Joined:
    Jun 17, 2010
    Posts:
    66
    Fantastic update! Thats my weekend gone, playing with the new features.
     
  33. Ayzhong

    Ayzhong

    Joined:
    Jul 21, 2010
    Posts:
    18
    Thanks for your reply again DB and I'll will be looking at the tutorial again to see what I did wrong. Also, for the tags, I tagged the pickupable model "pickupAble" but i didn't add a layer and i didn't add tags to any other object in the game. is there something i missed? anyways, your .95 updated looks awesome, so keep it up! i see lots of sites charging $10 for FPS packages not even close to as awesome as yours!
     
  34. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Did you try opening the Demo scene? I would check to make sure that it works there, and if it does see what's different than your scene.
     
  35. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    Nice! Downloasing now.
     
  36. mikesgames

    mikesgames

    Joined:
    Apr 16, 2010
    Posts:
    1,071
    wow, thanks for the new features. This is going to help me so much!
     
  37. Ayzhong

    Ayzhong

    Joined:
    Jul 21, 2010
    Posts:
    18
    Actually, it was just my dumb old computer lagging really bad in the editor window, so i built it into an executable and tested it and it worked. so i'll hav to use a different computer. thanks a lot, tho DB!
     
  38. Essal

    Essal

    Joined:
    Feb 16, 2010
    Posts:
    107
    I'm having sort of a weird bug here, whenever I add an audio component to something, in this case some speakers, that are supposed to play some ambient music, the audio gets all twisted and seems to be changing its pitch and playback speed whenever the player moves.
     
  39. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    This doesn't really sound like it's related to the weapons package, unless there's something you haven't mentioned. I've never encountered anything like that 9I'm not that familiar with the audio stuff), so I don't really know how to fix that aside from checking whether it's the rolloff value.
     
  40. PCGamerdude0091

    PCGamerdude0091

    Joined:
    Jul 26, 2010
    Posts:
    13
    Hey, sorry if this error was on the any of the last 13 pages but, I downloaded the new updated version and it gives me an error saying that something can't be imported on Windows (I'm a pc) and I can't do ANYTHING unless I deleted all of the objects and the one script that gives it the error. Why is this?
     
  41. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    That error isn't actually important - It's because of the file format of several of the models and it doesn't cause problems except for preventing you from modifying the mac-formatted models.

    I'd need more details to help with the issue of it not working. What actually happens? Also, are all of the inputs and tags defined properly?
     
  42. PCGamerdude0091

    PCGamerdude0091

    Joined:
    Jul 26, 2010
    Posts:
    13
    I imported it right into Unity and didn't save the files anywhere else :x so I can't recall what all of the files were, but I remember from the last update that I got an error message and couldn't play-test the game because of a "Large-Explosions?" script. I assumed that the others (models) would also have the same effect and weren't that important so I also deleted those.
    Thanks, but it might not have been as important as I thought it was at the time, deleting them stopped the errors from popping up. I just thought that my input might have been valuable in some way. Great work BTW.


    On another note, a good turret script would be awesome.
     
  43. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    That's strange; there shouldn't be any Large-Explosions script, and I've never encountered problems like that. So everything works now that you deleted stuff? The package doesn't have extra files in it so I would think deleting anything would cause some problems.
     
  44. FtsrelliK

    FtsrelliK

    Joined:
    Aug 2, 2010
    Posts:
    35
    Very well done, but I would like to know: how would I use this with, for example, a mini gun or grenade launcher - the launcher needs gravity, and the mini gun needs spinning. I didn't spend too long on it though, so I might've missed something.

    Otherwise, it's an amazingly good unity add-on. Thanks for making it.
     
  45. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    For the grenade launcher you would just use the "launcher" setting on the gunscript which fires a projectile (which you can put gravity on if you want). For the mini-gun you could do the spinning through animation or a small amount of coding within the existing script.
     
  46. kinifioluss

    kinifioluss

    Joined:
    Jan 14, 2010
    Posts:
    32
    This is great! I hope you guys can create something where you can switch between third and first person. Also I would like to be able to grab something and throw it.
     
  47. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    I'm glad you like it! We probably wouldn't add those features to this package (we want to keep it focused on being a functional player weapons in an FPS), but we're always looking to branch out ;-).
     
  48. reaper2259

    reaper2259

    Joined:
    Jan 19, 2010
    Posts:
    59
    just a quick question how could i make it so when you press tab to pick up a weapon it then gets deleted in the scene so the people can not pick it up again or see it(if you get what i mean) and also i was thinking it could be a good idea to add a feature that if the person who is making the game decides they want it so that when the player picks up a weapon it replaces the one they have in their hand already(if they have one)

    love the package guys you are doing great keep it up.
     
  49. FtsrelliK

    FtsrelliK

    Joined:
    Aug 2, 2010
    Posts:
    35
    Thanks. That works very well.

    Awesome work.
     
  50. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    To make the weapon disappear when you pick it up you could put something in the "selectableWeapon" script that destroys the weapon that was just picked up.

    Also, when you pick up a weapon it automatically replaces the currently equipped one.