Search Unity

FPS Constructor - Makes creating an FPS easy!

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

  1. NightHawk

    NightHawk

    Joined:
    May 30, 2012
    Posts:
    127
    - Sprinting doesn't function properly at all. But, when I am crouching, then press sprint, the player does go to standing position and I see the sprint display for a half second. And yes, I did add CamSway.js to the main camera.

    - Alright.

    -Yes, the explosions do damage to other objects. It's for the explosions I created. I am going to check back and see if anything needs to be changed.

    - I checked for colliders, and the only one I see is the one for the actual player.

    - I just checked again and it's these scripts:
    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityScript.Lang.Extensions.get_length (System.Array a)
    3. MaxKickbackX.Start () (at Assets/Plugins/DB Upgrades_Store/Upgrades/Components/Float(Multiplier)/MaxKickbackX.js:8)
    4.  
    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityScript.Lang.Extensions.get_length (System.Array a)
    3. KickbackAngleX.Start () (at Assets/Plugins/DB Upgrades_Store/Upgrades/Components/Float(Multiplier)/KickbackAngleX.js:8)
     
    Last edited: Mar 8, 2013
  2. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @Nighthawk
    -Ok. I think that the speed and the sprint issues are probably related, since sprinting is cancelled when the player is moving too slowly. Have you tried playing in the demo scene? If it works properly there, then it's the difference that's causing the problem.

    -Try using one of the default explosion prefabs, and see if that works.

    -For the upgrades - those components appear to have been replaced in 1.3. Try using KickbackAngle and MaxKickback instead.

    -I've also found the AI issue - it turns out that I was using a raycast to detect the player, when in reality raycasts cannot detect character controllers. I'll do a bugfix update sometime soon, but in the meantime you can fix this by opening up EnemyMovement.js and replacing the whole CanSeeTarget function with this:

    Code (csharp):
    1. function CanSeeTarget () : boolean {
    2.     //checks if target is visible, within field of view, or close enough to be heard
    3.    
    4.     var canSee = false;
    5.     var hit: RaycastHit;
    6.    
    7.     var targetAngle : float = Vector3.Angle(target.position - transform.position, transform.forward);
    8.     var targetDistance : float = Vector3.Distance(transform.position, target.position);
    9.     //is target within range and angle
    10.     if(targetDistance < viewRange  Mathf.Abs(targetAngle) < viewAngle/2) {
    11.         if(!Physics.Linecast(transform.position, (target.position), blocksVision)){
    12.             playerLastSeen = target.position;
    13.             canSee=true;
    14.             visitedLastSeen = false;
    15.         }
    16.     }
    17.     //is target close enough to hear?
    18.     if(targetDistance < hearRange){
    19.         playerLastSeen = target.position;
    20.         canSee=true;
    21.         visitedLastSeen = false;
    22.     }
    23.     return canSee;
    24. }
    25.  
    You'll also want to make sure that the 'blocks vision' variable on the enemies is set to the layers that should block enemy vision (in the demo scene this would only be the 'default' layer).

    Are you willing to share your project with me so I can take a look at this? It's almost always faster than trying to debug over email or the forums, If so you can email me at info@dastardlybanana.com to set that up.
     
  3. NightHawk

    NightHawk

    Joined:
    May 30, 2012
    Posts:
    127

    - It works in the demo scene. I am going to compare the two, and see what's the issue with it. Thanks.

    - Default explosions work perfectly. I'll use those instead.

    - No more errors now. :)

    - AI is working perfectly, thanks!

    - Is there a documentation or something for the spawning system? I'm kind of confused on it.

    Thanks for your help!
     
  4. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @NightHawk Ah, right. That isn't the prettiest system (just thrown together for the demo scene, not meant to be a feature or anything). Basically each wave object has X 'cube set' objects which correspond to the cubes spawned at a specific spawner (out of X spawners). The index in the CubeSet array corresponds to the index of a spawner in the spawner array.
     
  5. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    Hi i got unity pro 4 with Ios pro, everything with fps 1.2 works, but
    yesterday i updated to the 1.3 and doesn't work, please,help me.
    i started a new and clean project just with your fps,contructor
    opened the mobilejoystick scene demo and try to build for ios
    nothing added , scripts or anything else

    but the scripts fow weapons told and error, that somenthing like nolock properties,doesn't exist
    on the weapons,scripts of,the main camera of the,sample scene.

    i don't know what to do,cause i need it for ios
    anyone could help me?
    i suppose, all,of,you get the same error, and will be easy to resolve

    i hope

    thanks in advance
     
  6. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @Cloudfun

    Hi,

    So this happens even when you import the 1.3 version into a clean project directly from the asset store? Can you send an email with your exact errors to info@dastardlybanana.com?

    Thanks.

    Jason
     
  7. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    yes sorry cause i wrote you from my mobile
    the exact eror is
    Assets/Plugins/FPS Constructor V1/ScriptsDB/WeaponScripts/PlayerWeapons.js(165,87): BCE0019: 'isLocked' is not a member of 'WeaponInfo'.

    the scenario is
    MAC OSX with Unity 4.0 pro last version
    a new project , clean, just import your package from asset store
    using the mobilejoystick demo scene
    ante the swith plattofrm befor etry to run and build, the error appears
    Assets/Plugins/FPS Constructor V1/ScriptsDB/WeaponScripts/PlayerWeapons.js(165,87): BCE0019: 'isLocked' is not a member of 'WeaponInfo'.

    ill try to switch back to pc/mac to told you if persist ro if is just trying to do it on IOS
    thanks in adavnace jason
     
  8. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @cloudfun The fix is in your email. Thanks for bringing this to my attention!
     
  9. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    thanks jason you are so great
     
  10. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi Jason,

    What is the best AI solution you recommend for an FPS game that can be integrated with FPS constactor without problems?

    Thanks.
     
  11. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @bravery I don't know much about AI systems for the FPS Constructor. Any of them should work fine, you just need to hook in the damage stuff from the FPS Constructor.
     
  12. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi Jason,

    I have some questions:

    1- We can have a melee weapon however can we have multiple attack weapon, I mean we have several weapon attack animations? and not only one attack animation?

    2- instead of 2 arms can I put a complete character with it's own animation?

    3- can we do a slow motion attack something like max payne?

    Thanks
     
  13. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @bravery

    1- Yes, melee weapons support multiple attack animations (either ordered or random).

    2- Not for the weapon model. You would need to implement that separately on the player.

    3- You could probably change Time.timeScale.

    Thanks,

    Jason
     
  14. rowdyp

    rowdyp

    Joined:
    Feb 22, 2013
    Posts:
    13
    Is there going to be documents released going over the new features in the updated version?
     
  15. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @rowdyp that should be covered in the release notes in our documentation.
     
  16. rowdyp

    rowdyp

    Joined:
    Feb 22, 2013
    Posts:
    13
    Okay but that fails to mention anything about the new scripts in the enemies folder like waypoint, spawner, ect
     
  17. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @rowdyp The documentation is still in progress (It was a complete rewrite in addition to developing the site itself, so it takes time), so there should be more detailed information on the spawning stuff in the future.

    The reason they aren't really covered in the release notes is that I hadn't been looking at them as new features - the spawning was a quick and dirty implementation meant to facilitate the demo scene rather than be a serious part of the system. It hadn't even occurred to me that people would be interested in it (which in retrospect should have been obvious).

    That being said, if you have any questions about the waypoint/spawner/etc I can definitely answer them here or over email.
     
    Last edited: Mar 21, 2013
  18. NightHawk

    NightHawk

    Joined:
    May 30, 2012
    Posts:
    127
    Hello!

    Is there a way to disable horizontal recoil resetting?
     
  19. rowdyp

    rowdyp

    Joined:
    Feb 22, 2013
    Posts:
    13
    I was just wondering if the scripts allow the use of multiple waypoints since they are a transform
     
  20. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @NightHawk It looks like that isn't a variable yet (I'll note that for the next release). For now you can add the following line to line 338 of GunScript in Start())
    Code (csharp):
    1. mouseX.resetSpeed = 0;
    2.  
    @rowdyp yes - the waypoints are intended to be set in a circle, with each waypoint's script holding a reference to the next waypoint in the chain.
     
  21. ConnorC

    ConnorC

    Joined:
    Jul 6, 2012
    Posts:
    13
    The pack looks awesome evolved a lot since I last saw it, though one minor thing that isnt actually anything to do with the FPS side of things.
    you have a pretty cool wave defence game going on, if you could make the enemies easier to edit and give the ability to add walk, idle, run and a few different attack animations and a hurt animation to them I am sure you could interest a lot more people in to buying you package I know I would love to see this feature put in as it makes it that much easier to start making our own games with the package
     
  22. NightHawk

    NightHawk

    Joined:
    May 30, 2012
    Posts:
    127
    Thanks!
     
  23. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @ConnorC That's an interesting suggestion, but I think in the end there are a lot of other things that I would want to do before improving the enemies (multiplayer, player bodies, maybe spawning). The idea is for the system to integrate really easy with any existing or custom AI solution, which gives the users more options for AI.
     
  24. ConnorC

    ConnorC

    Joined:
    Jul 6, 2012
    Posts:
    13
    Well that makes a lot of sense, thanks for the reply though
    while I am in the suggestion mood, how about expanding on the melee side of things, the fact the axe is in the game is pretty cool but how about the ability to block with the axe so if an enemy is attacking you in close quarters you wont take damage, it would save from having to just keep running back from everything and it opens up more possibilities to what the kit could be used for
     
  25. rowdyp

    rowdyp

    Joined:
    Feb 22, 2013
    Posts:
    13
    Hey just a quick question, I am trying to set up some waypoints. I assume you have to attach the waypoint script to the objects serving as waypoints right? I did that, but all that happens is my enemy simply spins in circles around the 1st waypoint. Am I doing something wrong?
     
  26. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @ConnorC That's another thing in the same category as enemy behavior - I think it would be a cool feature, but I want to focus on the core FPS Behavior first. I'm also not sure if most of the users would have any use for it (this is the type of thing that would be cool to make as an add-on if the Asset store allowed it, some kind of comprehensive melee addition).

    @rowdyp Did you set up the 'next waypoint's for each of them? Every waypoint script has a spot for what waypoint the enemy should travel to after hitting this one.
     
  27. rowdyp

    rowdyp

    Joined:
    Feb 22, 2013
    Posts:
    13
    Yes I did set the next waypoint variable in the inspector
     
  28. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Make sure that the waypoint has a trigger collider, and that it can collide with enemies.
     
  29. rowdyp

    rowdyp

    Joined:
    Feb 22, 2013
    Posts:
    13
    Okay I will try that, how exactly do I make sure it can collide with enemies. Do I need to put it on a different layer or something? Also, did you change something in the highlightFx script for making pickupable weapons? Ever since I updated I cannot get my any of my pickupable weapons to work.
     
  30. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi Jason_DB,

    I bought this plugin, but I would like to know if there is any tutorial I can follow in-order to learn (step-by-step) how to configure / customize this plugin for my own needs?

    Thanks
     
  31. rowdyp

    rowdyp

    Joined:
    Feb 22, 2013
    Posts:
    13
    Bravery did you take a look at the previous release documents, there are some details there.
     
  32. AlexZ

    AlexZ

    Joined:
    Sep 17, 2009
    Posts:
    263
    When you get multi-player I will get this! :D Just make sure its Photon or something equally as good.
     
  33. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @rowdyp
    Most things should collide with enemies. You just need to make sure that the layer of the trigger and the layer of the enemies are not set to ignore each other in the collision settings.

    @bravery
    Everything you need should be in the documentation. If you have any questions that aren't covered by that, just email me at info@dastardlybanana.com.

    @AlexZ Great! I'm not sure how specific the multiplayer implementation would be in the end, hopefully it will be flexible enough to support photon as well as other solutions.
     
  34. rowdyp

    rowdyp

    Joined:
    Feb 22, 2013
    Posts:
    13
    Yeah I got the waypoints working, but I am still having problems getting my pickupable weapons to work though
     
  35. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @rowdyp what is happening exactly? Do they highlight when looked at, but not pickup when activated?
     
  36. ozoner

    ozoner

    Joined:
    Jun 8, 2009
    Posts:
    85
    Jason- I have been using your FPS for a while now and am about to include it in a project I am about to start. So I started a new project and noticed you had an update and I down loaded no issue there. But when I tried to import it into,an empty project I got this error:

    Type==kMetaAssetType pathName.find ("library/metadata") !=0

    I have run Unity version 3.5.7f6 on both of my Macs and got the error on both. Can you guide me to where I can get this resolved as I want to start this project Monday and will be prepping this weekend.

    By the way I noticed you are from Connecticut, I grew up in Enfield.

    Thank you,
    Henry Jr.
     
  37. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    I'm also going to get this kit, when multiplayer is added
     
  38. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @ozoner I've never seen that issue before, but it looks like it could be an issue with the project upgrading to 4.0. If it downloaded correctly into an existing project then I'm not so sure, what is different between the project where it works and the project where it doesn't?
     
  39. ozoner

    ozoner

    Joined:
    Jun 8, 2009
    Posts:
    85
    I will get one of the older labs I did with the kit and see if the new version will upgrade the existing project ( lab ) since I am not on on 4 and do not plan on upgrading till mid-mid summer as I have three more customer requested projects and want no issues. If that does not work I will take one of the labs I have rip it till it's just the FPS and start the new project that way. I will experiment and find a solution, as there are a lot of solutions out there.

    Respectfully,
    Henry Jr.
     
  40. rowdyp

    rowdyp

    Joined:
    Feb 22, 2013
    Posts:
    13
    They highlight and the description box pops up that tells you to press tab, but the tab button had no effect. I triple checked the input and it is right
     
  41. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @ozoner let me know how it works. If you can't import it through the asset store due to the version difference we can probably find a way by manually exporting a package for you to use.

    @rowdyp Are there any error messages, or does nothing happen? Is the pickup set to connect to a weapon?
     
  42. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    Just bought it!!! Also just have a few questions. Is there any chance will get multiplayer within 3 months? Another question I was kind of hoping for 24 players on a server at least. Trying to make a smaller day z game. Would that be possible with the multiplayer you're planning. Also can we use the FPS camera with your fps constructor?
     
    Last edited: Apr 18, 2013
  43. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    hi jason i really need your help
    somethng strange happens with player prefab
    im trying to add a staticscreen effect as you could see on this post
    http://answers.unity3d.com/questions/373575/how-to-make-screen-player-broken-if-look-enemy-.html
    i just did these steps
    1/ create an empty gameObject
    2/ attach this script staticscreen attached
    3/ make the object a child of the camera

    if i did on a standard fps control, everything works ok
    but if i attach to your fps prefab , the camera just render black, dont works
    if i try to attach to the weapon camera is the same

    im realy lost, is possible to support me?
    thanks a lot in advance
     

    Attached Files:

  44. AlexZ

    AlexZ

    Joined:
    Sep 17, 2009
    Posts:
    263
  45. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    Hey Jason, Loving the product, but on the demo scene, I couldn't pick up the weapons, lean, sprint, or see the store. Also the square zombies didn't really show up. Is there any way you could walk me through some of this.
     
    Last edited: Apr 19, 2013
  46. rowdyp

    rowdyp

    Joined:
    Feb 22, 2013
    Posts:
    13
    $screen1.jpg Yes, the pickups are set to weapons and there are no error messages. This is how my drop looks in the inspector
     
    Last edited: Apr 19, 2013
  47. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    Hey, I figured out how to make sprint, tab to pick up, and everything. Only thing that doesn't work is the leaning system with "q" and "e". Now I just got to figure out how to add my own weapons and enemies. Question though, can I just change your weapons and add my model from the asset store. I bought a modern gun pack for ten dollars, had a sniper, a heavy machine gun, m16 and famas. Or do I have to do all the animations for each gun if I want to use new models? Also your red enemies are perfect for the zombie game I want to make, also could I use that code with my zombie models I bought off the asset store for 50.00. This pack already has it's own animations just wanted to ask if I could just somehow use my models with your red block code. Thanks for helping a newbie.
     
    Last edited: Apr 20, 2013
  48. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    @Shigidy are the inputs for lean left and lean right set up?

    Also, you can use the new weapon models with the existing animations by replacing the gun part of the model with your new one. It might not line up 100% right because the animations were designed for another model, though. You should also be able to use the zombie models, although you'd need to hook in their animations. The red cubes are mostly meant as a basic example for how to handle enemies.

    As far as multiplayer, I'm not sure. I would certainly like to get it done, but as the only person working on this it'd hard to predict.

    @rowdyp Are you willing to send me your entire project so I can take a look directly? Also

    @Cloudfun I can't quite tell what is happening without more information. Is the material on the object not set correctly (black) or is the camera not rendering?
     
  49. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    Thanks for the quick response, also Jason have you heard of team view. It allows you to take over my computer, and perhaps help customers. Don't know if you ever would go down that route, but it's an option.
    Also if you could help me, how do I make my new model a children of the prefab fal. Like I'm trying to make my m16 instead of the fal. Also do I have to make the gun into separate parts like you did with fal. Like barrel, grip, and stock.
     
    Last edited: Apr 20, 2013
  50. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    Also, man I must be really dumb, because I can't figure out how to change the gun to my model. Is there anyway you could help me with Skype or something else?

    I can figure out how to delete it, but when I add the other model in it's place add the game script for the new model, it just shows his hands.
     
    Last edited: Apr 22, 2013