Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

FPS Constructor - Makes creating an FPS easy!

Discussion in 'Assets and Asset Store' started by Jason_DB, Dec 30, 2011.

  1. BGT

    BGT

    Joined:
    May 21, 2012
    Posts:
    5
    Thanks for the quick reply Jason,
    Yes, I know isPrimaryWeapon is checked/unchecked in the inspector, and the GunScript for the Secondary Weapon is dragged, and tried two ways, one is a second GunScript in the same weapon (same as FAL has) and also creating a new weapon just for the AltFire with all the right checkboxes selected and still can't make it work.

    Actually if I make a new clean install of the FPS Constructor 1.1, and change the AltFire type for the FAL from Launcher to Melee, doesn't work for me, I just go to the box and hit it, no sound no animation no FX. I must say that the by default FAL's Launcher works, I just change it to melee and then nothing. I tried also the Axe as AltFire but also nothing.

    Anyone succeed with this? Thanks everybody in advance.
    Cheers
     
  2. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @BGT Ah, that means that the problem is actually the melee weapon itself, and not the fact that it is a secondary. The melee weapon type is a little odd. Did you set up the hitbox for your melee weapon? It's not very clear from looking at the inspector, but you need a collider with the script 'HitBox' somewhere under the melee weapon in the hierarchy.
     
  3. Sriracha

    Sriracha

    Joined:
    Mar 15, 2011
    Posts:
    3
    You should really add mouse smoothing if you haven't yet. Aiming at something far away with the scope is useless. I know someone mentioned it is bulky. What we need is this package combined with the features of "The Ultimate FPS Camera"'s features. both are great, this one in particular but the lack of mouse smoothing is frustrating to me and I'm no programmer so I can't add it.
     
  4. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @Siracha I'll look into adding an option for it in the incoming update.
     
  5. BGT

    BGT

    Joined:
    May 21, 2012
    Posts:
    5
    Hi again Jason,
    Yes, I set up the hitbox for the melee weapon, exactly same way as the Axe (collider, rigidbody, hitbox, etc..) and couldn't make it work, so finally I made it work in another way, not very clean but works fine for me.

    I have as primary weapon a machinegun with a hitscan gunscript, and another machinegun (same model) as secondary weapon with a melee gunscript. So when pressing AltFire I play the altfire animation (hit with the machineguns stock) in the primary weapon. Damage, animation, sound and force seems fine.
    Thanks for the support!
     
  6. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @BGT Thanks for bringing this to my attention! I actually found and fixed the problem. It'll be in the next update, but here's the code if you want to change it now:

    In PlayerWeapons.js line 103, replace
    with
     
  7. staincorb

    staincorb

    Joined:
    Mar 30, 2009
    Posts:
    123
    Hi Jason, Was looking at documentation and did not see nothing abought multiplayer, I know this has no networking in it but, is your pakage easy to set up a multiplayer sistem if I already have the networking ?
     
  8. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @staincorb The information you need for multiplayer should be easily accessible, I just don't know of any examples of it being done yet.

    I would be very interested in helping someone who is using the package for multiplayer, so if you decide to use it email me and I'll work with you to make as easy as possible to integrate.
     
  9. staincorb

    staincorb

    Joined:
    Mar 30, 2009
    Posts:
    123
    Sounds cool, im going to test out a nother sistem for now, but since I cant really program probably buy your package in the end.
     
  10. NightHawk

    NightHawk

    Joined:
    May 30, 2012
    Posts:
    127
    Hi!

    I have a few questions.

    1. Is it possible to add prone?

    2. Is it possible to make a script like this: http://forum.unity3d.com/threads/126886-Ultimate-FPS-Camera-RELEASED work with the FPS constructor?

    3. Is it possible to have X amount of attachments for a weapon without making another model for it?

    4. (I'm sure this is already possible) Can there be a plasma based weapon that works off of a battery (Sort of like halo plasma weapons)?

    5. Is it possible to have different aiming animations? For example, different animations for firing from the hip and a different animation for firing while aimed down the sight.

    6. Is it possible to have a lock-on weapon lock on to certain things? Like a vehicle for example.

    6a. Is it possible to have finishing moves with certain weapons? Like Battlefield 3's knife?

    6b. Is it possible to have certain weapons take a ton of damage on certain objects? Like a backstab in TF2?

    6c. Is it possible to have damage multipliers? For example, the head and neck of a character is a 1.5x multiplier.

    7. Is it possible to have things like Equipment? Like throwable C4, claymore, bubble shield, etc.

    7a. Is it possible for a weapon that turns the view on a camera? For example, It turns the camera of a character in multiplayer?

    8. Is it possible to have gun kick and view kick? For example, Shooting a gun makes the camera and gun shake.

    9. This may be hard to do but is it possible to have bullet drop?

    10. I am sure this is very hard to do but... Is it possible to have a blend into environment? For example, Can the player press a button to blend into a bush or something to make it hard for AI/players to see the player "blended in"?

    :)
     
  11. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @Nighthawk hey!

    1. I'm looking into it for future updates.

    2. I haven't looked into it specifically, but I think it should work. There is a component that controls weapon motion in the FPS Constructor that could probably be replaced with the ultimate FPS Camera's movement. If anyone wants to try combining them I can help out.

    3. You never *need* a model for an attachment unless you want it, so it really comes down to that. For the FAL I have two versions of the model's arms - one with grenade launcher and one without - because they have to be positioned differently. Once I have that, though I could probably use those arms for as many underbarrel attachments as I like. Things like scopes can always just be stuck on top of a model.

    4.That would need to be a charge weapon, but yes. There is actually a new example laser that uses an overheat system instead of ammo.

    5. You would need to write a very small script (or email me to write one) to switch the firing animations, but yes it would be possible.

    6. Yes. This is another case where it needs a charge weapon, but as you can see by the seeker missiles in the demo (probably my favorite demo weapon) lock-on is completely possible.

    6a. It's possible, although I probably wouldn't make it a weapon. The FPS Constructor has functions and variables in place to let you override the standard behavior, so in this case you could stop movement, hide the weapon, and do a cool kill animation when you hit a certain key behind an enemy.

    6b. I can think of ways to do that.

    6c. Yes. That would be done by the damage receiver on the enemy.

    7. Don't think of a 'weapon' in this system as just a gun, it can really be just about anything. A projectile weapon can use any rigidbody as a projectile, so you could set the projectile to be c4/claymore/etc. You could also follow my advice for 6a if you don't want it to be a weapon you switch to.

    7a. I'm not sure I follow? I suppose that you could move the camera if you wanted to, although that would be somewhat difficult.

    8.The gun does not shake individually from the camera (because that's covered by the animation), but there is shake/kickback involved. You can control how much there is (both x and y), how far it can go, and how quickly it returns to normal.

    9. It would be easy, actually. Right now the traditional guns use raycasts, which don't drop. If you want bullet drop, just switch them over to a projectile weapon and put physics on the bullet projectile.

    10. If you have a shader to do that, it wouldn't be hard. The upcoming upgrades system actually has scripts to swap out the materials on your weapon, so you could use that. I imagine the hard part would be getting the right shader for the blend-in effect.
     
  12. TheBooBear

    TheBooBear

    Joined:
    Dec 15, 2011
    Posts:
    95
    Jason,

    I have an odd issue with the mobile setup and happens both in my app and your demo. After the player dies and does a "try again", the level is reloaded properly, but the controller can no longer turn or look up or down.
     
  13. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @Drunken Monkey

    It looks like there's an issue with LockCursor - the 'mobile' variable is actually doing the opposite of what it should. Try going into LockCursor.js and replacing the body of Awake with just 'mobiel = false;'
     
  14. bbsbot

    bbsbot

    Joined:
    May 23, 2012
    Posts:
    84
    Hello, Jason

    how long till the next release? any news? how many and what new features will include in version 1.2 ?
     
  15. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    It's not version 1.2 yet, because there are some things that aren't done yet. Here's the list for 1.1.1:

    I'm working on submitting it today or tomorrow, although google docs kind of broke the documentation, which is slowing it down.
     
  16. bbsbot

    bbsbot

    Joined:
    May 23, 2012
    Posts:
    84
  17. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Just submitted 1.1.1 to the asset store! I'm excited about this one, both because it's way more C# friendly, and the upgrades system is pretty awesome! Because the store isn't included yet, you'll have to activate the upgrades manually. Here are the release notes:

    Here's a video of the upgrades in action (showing some custom upgrade examples). It's from the previous release of the upgrades, but still applies.

     
  18. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    1.1.1 is live!
     
  19. TheBooBear

    TheBooBear

    Joined:
    Dec 15, 2011
    Posts:
    95
    Jason,

    What are the proper upgrade steps for 1.1.1?

    Getting a tone of these..

    Assets/Plugins/DB Upgrades_Store/Upgrades/Components/Boolean/AutoFire.js(1,15): BCE0018: The name 'GunScript' does not denote a valid type ('not found').
     
  20. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @Drunken Monkey just drag the FPSConstructor folder into plugins (this will also make C# integration easier).
     
  21. TheBooBear

    TheBooBear

    Joined:
    Dec 15, 2011
    Posts:
    95
    Jason,

    Still having some mobile issue after dying. Setting Mobile=False just breaks the whole control system. Any suggestions?
     
  22. mikevanman

    mikevanman

    Joined:
    Sep 30, 2009
    Posts:
    108
    is their an easy way (or feature request) to have to pickups (ammo and health) be triggered by simply walking into it, rather than pressing the "interact" button

    cheers
     
  23. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @Drunken Money That's very strange, I'm not having similar behavior at all. I'll look into it.

    @mikevanman you can just take what it already does, but call the function with a trigger or something.
     
  24. TheBooBear

    TheBooBear

    Joined:
    Dec 15, 2011
    Posts:
    95
    Yeah, the player never gets actived, so I assume lockcursor is not getting called for some reason. Works great until your die.

    I am testing on a couple android devices. HTC Thunderbolt and a Samsung Galaxy Tab 10.1... I'll dig out an iphone and test on it.
     
  25. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @Drunken Monkey the idea is that the 'mobile' variable prevents LockCursor from causing problems, there just must be an edge case where that isn't happening.
     
  26. angel_666

    angel_666

    Joined:
    Apr 8, 2012
    Posts:
    5
    Just get the package, and it's great! I trying to build it for Android - and all seems to work fine on my device (Samsung GalaxyTab). But i have one (sorry if stupid) question: How can i implement Joysticks from Unity's Standard Assets Mobile to FPS Constructor's Input system? I mean, i know how to setup touch buttons, But how can i set up standard Joystick GUI for Player control (left joystick move player, right joystick move aim)? Thanks!
     
  27. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @angel_666 Thanks!

    To add joysticks, you just need the joysticks to change the axis values on the 'Horizontal', 'Vertical', 'MouseX', and 'MouseY' Input items. These can be found under the InputManager object (childed to the Manager). You can take a look at Tilt.js for an example of implementing controls.
     
  28. angel_666

    angel_666

    Joined:
    Apr 8, 2012
    Posts:
    5
    Hi, thanks for quick answer! But i'm newbie in scripting and not fully understood you first phrase
    We have InputManager, and we have a standard Joystick script with GuiTexture. What i must do next? I see the Tilt example, and i understand how it works, but i break my head with joysticks.. If we use tilt, we get inputs from device accel., but joystick script does not tell us any axes.. It tell just texture position.. As i see in standard mobile FirstPersonControl.js, it use Position:
    Thanks and sorry if i ask elementary things..
     
  29. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @angel_666 I'm not sure, I imagine you would get the values from the position of the joystick or finger? Then those values would go to the axis.
     
  30. angel_666

    angel_666

    Joined:
    Apr 8, 2012
    Posts:
    5
    @DastardlyBanana
    Ok. I found my problem: It seems that i can't declare Joystick, because it can't seen from "plugins" folder...
     
  31. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @angel_666 just drag it into 'plugins'.
     
  32. slimjim2417

    slimjim2417

    Joined:
    Feb 14, 2012
    Posts:
    45
    Just real quick I want to say thank you to the guys at DB, they have made my life making my game so much easier. I have one question though, how do you add reload sounds to weapons?

    please respond ASAP, I am planning on putting a demo video on youtube. I will include a link in a post once its up, I just want some reload sounds before I put it up.

    Thank you
     
  33. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @slimjim2417 Thanks! I'm looking forward to seeing the demo!

    Reload sounds are actually linked to the reload animation (there wasn't another way to make them work with the ability to change reload speeds). First duplicate the animation asset in your project and replace the version on your weapon. Then open the animation editor, and use animation events to trigger the functions on ReloadSounds.js.
     
  34. slimjim2417

    slimjim2417

    Joined:
    Feb 14, 2012
    Posts:
    45
    ok when I go to add the sound to the animation event i select, ex, play4, it says the function is not supported thus the sound will not play.
     
  35. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @slimjim2417 is there definitely a 'ReloadSounds' component on that object?
     
  36. slimjim2417

    slimjim2417

    Joined:
    Feb 14, 2012
    Posts:
    45
    yes i added the script and the sounds i wanted into the slots
     
  37. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @slimjim2417 Huh. It's telling me the same thing, but the sound is playing fine.
     
  38. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @DrunkenMonkey Found the problem! Turns out that a static 'freeze' variable set on death was causing the problem. To fix it, just add the following line:

    To line 34 of DeathEffects.js, right before the call to Application.LoadLevel(0).
     
  39. TheBooBear

    TheBooBear

    Joined:
    Dec 15, 2011
    Posts:
    95
  40. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @Drunken Monkey Very cool! Is it going to be one mobile, or are you just trying out the controls?

    Also - to this or any other projects made with the FPS Constructor, if you want me to link/tweet your game's website or trailer I'm happy to! I'd also love to see more stuff posted here!
     
  41. TheBooBear

    TheBooBear

    Joined:
    Dec 15, 2011
    Posts:
    95
    The plan is mobile first, iPhone/iPad... Really my learning "How To" project.....
     
    Last edited: Jun 15, 2012
  42. TheBooBear

    TheBooBear

    Joined:
    Dec 15, 2011
    Posts:
    95
    That fixed solved the issue after dying.. Thanks for the help...
     
  43. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    hi , i buy your product yesterday
    my idea is to do a FPS on IOS, ill do some videos
    well
    im a littel bit lost, hope you could help

    i start an empty project
    and import the package
    opened the mobilescene, to customize

    i add the the layers and inputs as your doc indicates

    but i not able to get it working, i got unity 3.5.2 pro with ios and android license
    there are al least two problems

    1 the SwitchWeapon under Input manager is red on hierarchy and tells on the inspector that the "Missing" and "The source Prefab or model has been deleted

    2 the is an runtime error
    NullReferenceException: Object reference not set to an instance of an object
    AimMode.Update () (at Assets/Plugins/FPS Constructor V1/ScriptsDB/WeaponScripts/AimMode.js:140)

    and im lost
    can you help
    what im doing wrong?
    thanks a lot in advance
     
  44. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @cloudfun Hi,

    The first thing shouldn't be a problem, it'll work fine without the prefab. For the second issue, find the 'Bearded Axe' weapon and check 'Primary Weapon' under 'Alt-Fire Properties'.
     
  45. slimjim2417

    slimjim2417

    Joined:
    Feb 14, 2012
    Posts:
    45
    Hmmmm I don't know why but my sounds still wont play, I put the script on the gun game object (the physical model) that i also put the gun child animation script on as your documentation says, all my anims work fine I just can't get the sounds to play in the reload anim
     
  46. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @slimjim are you sure the sound itself isn't the problem? I have the same error message that you did and it plays fine for me...
     
  47. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    hi jason thanks a lot for your response, fast and perfect

    can i made another question?
    now it runs on my ipad perfect,is compiles etc
    but the movements on the ipad are good , but al leats in the demoscene theres no crosshair and im not able to look at the enemys or turn , look up or look down, just use the gyroscopes to go or go back

    is my fault? or i must to implement the crooshair and camera movements to fllow the crosshair etc?
    could you give a point to start to do that?
    thanks in advace jason
     
  48. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @cloudfun I'm not sure what would cause that, but it's not your fault. The full movement should be supported in mobilescene.

    Are you geting any errors, or is it just not working?
     
  49. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    no i dont get any errors
    it compiles, works fine good performance etc
    but theres no movement either crosshair like in pc that mouse movements moves the camera etc

    any idea?
     
  50. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @cloudfun is your project set to compile to mobile? Make sure that you set your project to an iOS project.