Search Unity

FPS Kit | Version 2.0

Discussion in 'Assets and Asset Store' started by NSdesignGames, Oct 2, 2012.

  1. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
    It's possible...what problem are you having...sounds like your needing a script written for this purpose....what do you have so far?
     
  2. ebenpower

    ebenpower

    Joined:
    May 12, 2014
    Posts:
    2
    Hello how can add password select for the game rooms ? Any idea please ?
     
  3. Slobo

    Slobo

    Joined:
    May 13, 2014
    Posts:
    1
    Hi, does anyone know how to add bullet marks onto a player controlled soldier?
    I tried the way described in the OP tutorial, which clearly works for immobile objects such as walls etc., changed the tag of the soldier model to Metal for example, but no marks showed up.
     
  4. ik_jolan

    ik_jolan

    Joined:
    Jul 26, 2013
    Posts:
    15
    Hello,
    I had to move the script photonview and others so I could use them in javascript as well (needed it badly)
    now, PhotonView.cs was unattached to all objects it was attached tobefore moving it, so I had to reattach te script to all objects...

    The problem is, I can not use it properly on the networkplayer, I can't attach the c# networkplayer to 'observe'
    before moving:
    $with.jpg
    after:
    $without.jpg

    so, is there anybody who can explain/help me out with this?
    The networkplayer can not see other players at this moment...
     
  5. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80

    remove each script you added until it allows you to add it, why not covert the java to c#

    Convert unity javascript (unityscript) to C# - M2H --- google search this
     
    Last edited: May 17, 2014
  6. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80

    Dunno if this is why but certainly sounds like it. Likely you need to tag the body not just prefab. I've found when there's a gameobject with a tag set ie. buildings/props etc attached to it they only get impact decals when they are tagged also. If its just the base object tag for some reason the parent tag doesn't apply to all the child objects. When I was adding in my AI zombies I also had to tag the limbs and not just the prefab.
     
  7. johnson07

    johnson07

    Joined:
    Oct 10, 2013
    Posts:
    15
    @Thrillkill His "Zombie AI" works with multiplayer too ..?
     
  8. ik_jolan

    ik_jolan

    Joined:
    Jul 26, 2013
    Posts:
    15
    I need it in javascript, c# does not support everything, I already tried to convert it, but it doesn't work (array problems etc)

    And I did not add any other script, the strange thing is, I can't even find the networkplayer.cs file, does this even exists?
     
  9. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    What do you mean by this? C# supports everything *ahem* Unityscript *ahem* supports, and then some.
     
  10. ik_jolan

    ik_jolan

    Joined:
    Jul 26, 2013
    Posts:
    15
    when I convert the scripts, I got errors from c# to unityscript
    + It was more usefull to have PhotonView.instantiate/destroy/etc in unityscript instead of converting everything...
     
  11. johnson07

    johnson07

    Joined:
    Oct 10, 2013
    Posts:
    15
    that you're saying.?
    for, programming with Photon is much better to use C # ..!
     
  12. King Sosa

    King Sosa

    Joined:
    May 18, 2014
    Posts:
    2
    Thanks guys for keeping this thread alive with custom scripts and mods!
    But, I wonder if it is possible to combine this kit with Realistic FPS Prefab or UFPS or ArmedUnity Premium FPS Kit?
    Please, answer kindly, as I am new to programming. And if it is possible to combine them, what difficult level is it (easy, moderate, hard?).

    *With combining I mean to use FPS Kit Version 2.0 Mutliplayer features, but the controller to be realistic using any of these kits.
     
  13. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80

    It's actually not to hard all. I have the AU FPS Kit, biggest beef with it is JS mixed with some C# though but can use the converter to do most of the work then you modify the rest but for the most part i have the parts I wanted to work without issues. I'm reviewing the vehicle controls to see about fixing the script i posted to work properly but this NGUI business has all my time right now.

    Realistic FPS however, I converted the AI and it wasn't that hard to merge into this kit and setup zombies. As for the AI you just need to write/custom the script to work with the controller in this kit. Personally I prefer this framework, likely because I'm finally comfortable with it and have been overhauling a lot of the scripts. I have been watching the UFPS camera and have been considering getting that one but I'm trying not to spend a tonne of money on something that's just for fun. It looks pretty good and from what I've read its worth it.

    This kit does not have a whole lot of documentation and it isn't commented. It is not something a new person learning unity or c# will want to start with but really that's a comfort level thing. You could stumble through and use google to figure it all out. That aside, if you do have a basic fundamental knowledge of how c# and unity works you will find this code very easy to pickup and start modding right away. The FPS controller is pretty basic and that's really what all the other kits have over this one,s more controls and things a player can do. If this had more playercontroller options those other kits would not really be that much different.
     
  14. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
    It doesnt do a full convert you actually have to know C# to fill in some of it. It's just a lot faster then doing it manually but its not flawless. I don't know what that script is either....your probally looking for playernetworkcontroller.cs I don't have or use a script called networkplayer.cs. I think your prefab is missing the script i mentioned?
     
  15. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
    everything i do is multiplayer
     
  16. King Sosa

    King Sosa

    Joined:
    May 18, 2014
    Posts:
    2
    Thank you very much for this detailed information.
    Well, I learned Unity pretty well. I mean, I can use Unity and I know mostly everything on Unity. However, I'm completely new to scripting (with completely new I mean I don't know anything about scripting). So, can you recommend me a great series of tutorial for C# (which would actualy help me to understand FPS Kit Version 2.0). Thank you again!
     
  17. Fictional

    Fictional

    Joined:
    May 19, 2014
    Posts:
    2
    Hi guys.
    I am using old version this kit. Beceuse I was make changes on it.
    But I have a mouse sensitivy settings problem.

    You can see my problem in this video;

    [HR][/HR]
    Here orginal FPSMouseLook.JS :

    Code (csharp):
    1.  
    2. #pragma strict
    3.  
    4. enum RotationAxes{ MouseXAndY, MouseX, MouseY }
    5. var axes = RotationAxes.MouseXAndY;
    6. var sensitivity : float = 4;
    7. var aimSensitivity : float = 2;
    8.  
    9. @HideInInspector
    10. var sensitivityX : float = 15;
    11. @HideInInspector
    12. var sensitivityY : float = 15;
    13. private var minimumX : float = -360;
    14. private var maximumX : float = 360;
    15.  
    16. var minimumY : float = -80;
    17. var maximumY : float = 80;
    18.  
    19. private var rotationY : float = 0;
    20.  
    21. //Find WeaponManager script to know when selected weapon is aimed or not
    22. private var weapManager : WeaponManager;
    23. private var weapScript : WeaponScript;
    24.    
    25. //Added for sniper scope
    26. @HideInInspector
    27. public var currentSensitivity : float;
    28.  
    29. function Awake (){
    30.     weapManager = gameObject.FindWithTag("WeaponManager").GetComponent.<WeaponManager>();
    31. }
    32.  
    33. function Update (){
    34.    
    35.     if(Time.timeScale < 0.01)
    36.         return;
    37.     if (axes == RotationAxes.MouseXAndY){
    38.         var rotationX : float = transform.localEulerAngles.y + Input.GetAxis("Mouse X") * sensitivityX;
    39.            
    40.         rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
    41.         rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
    42.            
    43.         transform.localEulerAngles = new Vector3(-rotationY, rotationX, 0);
    44.     }
    45.     else if (axes == RotationAxes.MouseX){
    46.         transform.Rotate(0, Input.GetAxis("Mouse X") * sensitivityX, 0);
    47.     }else{
    48.         rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
    49.         rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
    50.    
    51.         transform.localEulerAngles = new Vector3(-rotationY, transform.localEulerAngles.y, 0);
    52.     }
    53.    
    54.     //Find current selected weapon script
    55.     if(weapManager.SelectedWeapon){
    56.         weapScript = weapManager.SelectedWeapon.GetComponent.<WeaponScript>();
    57.     }
    58.     //Check if weapon aimed or not
    59.     if(weapScript  weapScript.aimed){
    60.         currentSensitivity = aimSensitivity;
    61.     }else{
    62.         currentSensitivity = sensitivity;
    63.     }
    64.     sensitivityX = currentSensitivity;
    65.     sensitivityY = currentSensitivity;
    66. }
    67.  
    68. function Recoil(amount : float){
    69.     rotationY += amount;
    70. }
    71.  
    72. @script AddComponentMenu ("FPS system/Character/FPS MouseLook")
    [HR][/HR]

    Here my FPSMouseLook.JS :

    Code (csharp):
    1. #pragma strict
    2.  
    3. enum RotationAxes{ MouseXAndY, MouseX, MouseY }
    4. var axes = RotationAxes.MouseXAndY;
    5. var sensitivity : float = 4;
    6. var aimSensitivity : float = 2;
    7. //I EDIT HERE
    8. @HideInInspector
    9. var sensitivityX : float;
    10. @HideInInspector
    11. var sensitivityY : float;
    12. //UNTIL HERE
    13. private var minimumX : float = -360;
    14. private var maximumX : float = 360;
    15.  
    16. var minimumY : float = -80;
    17. var maximumY : float = 80;
    18. //I ADD THESE
    19. var paused : boolean;
    20. var enableHelper : GameObject;
    21. var setSensitivy : float = 15;
    22. //UNTIL HERE
    23.  
    24. private var rotationY : float = 0;
    25.  
    26.  
    27. private var weapManager : WeaponManager;
    28. private var weapScript : WeaponScript;
    29.    
    30.  
    31. @HideInInspector
    32. public var currentSensitivity : float;
    33.  
    34. function Awake (){
    35.     weapManager = gameObject.FindWithTag("WeaponManager").GetComponent.<WeaponManager>();
    36.  
    37.     //I ADD THESE
    38.     enableHelper = GameObject.FindWithTag("EnableHelper").gameObject;
    39.     paused=false;
    40. }
    41.  
    42. function Update (){
    43.     //I ADD THESE
    44.     sensitivityX=setSensitivy;
    45.     sensitivityY=setSensitivy;
    46.    
    47.     if(enableHelper.activeSelf == true){
    48.     if(Input.GetKeyDown(KeyCode.Tab)  paused==true){
    49.     paused=false;
    50.     }
    51.     }
    52.     if(enableHelper.activeSelf == false){
    53.     if(Input.GetKeyDown(KeyCode.Tab)  paused==false){
    54.     paused=true;
    55.     }
    56.     }
    57.     //UNTIL HERE
    58.    
    59.    
    60.    
    61.    
    62.    
    63.     if(Time.timeScale < 0.01)
    64.         return;
    65.     if (axes == RotationAxes.MouseXAndY){
    66.         var rotationX : float = transform.localEulerAngles.y + Input.GetAxis("Mouse X") * sensitivityX;
    67.            
    68.         rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
    69.         rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
    70.            
    71.         transform.localEulerAngles = new Vector3(-rotationY, rotationX, 0);
    72.     }
    73.     else if (axes == RotationAxes.MouseX){
    74.         transform.Rotate(0, Input.GetAxis("Mouse X") * sensitivityX, 0);
    75.     }else{
    76.         rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
    77.         rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
    78.    
    79.         transform.localEulerAngles = new Vector3(-rotationY, transform.localEulerAngles.y, 0);
    80.     }
    81.    
    82.  
    83.     if(weapManager.SelectedWeapon){
    84.         weapScript = weapManager.SelectedWeapon.GetComponent.<WeaponScript>();
    85.     }
    86.  
    87.     if(weapScript  weapScript.aimed){
    88.         currentSensitivity = aimSensitivity;
    89.     }else{
    90.         currentSensitivity = sensitivity;
    91.     }
    92.     sensitivityX = currentSensitivity;
    93.     sensitivityY = currentSensitivity;
    94. }
    95.  
    96. function Recoil(amount : float){
    97.     rotationY += amount;
    98. }
    99.  
    100. //I ADD THESE
    101. function OnGUI(){
    102. if(paused==true){
    103. GUI.Label(Rect(10,120,100,30),"Mouse sensitvy");
    104. setSensitivy = GUI.VerticalSlider(Rect(20,160,20,100), setSensitivy, 0.0, 30.0);
    105. }
    106. }
    107.  
    108. //UNTIL HERE
    109.  
    110.  
    111. @script AddComponentMenu ("FPS system/Character/FPS MouseLook")


    Someone help me please? I can't fix this. :confused:
    Sorry for my English skills, thanks for everything.
     
  18. johnson07

    johnson07

    Joined:
    Oct 10, 2013
    Posts:
    15
    try only change with this:

    Code (csharp):
    1. if(Input.GetKeyDown(KeyCode.Tab){
    2. paused = !paused;
    3.  
    4. }
     
  19. Glentved

    Glentved

    Joined:
    Oct 30, 2013
    Posts:
    10
    Hi
    I am very new to Unity, C# and game making in general, and this is my first post.
    So I want to start with this co-op fps game, and I have read that I should start with the multiplayer part.
    From what I find, I think “FPS kit | Version 2.0” has most of the basic thing, and I am planning to buy it.

    Where can I find a noob tutorial or sample script for npcs that includes basic AI, synchronized animations and all other important things, to make it work with FPS kit? Just like the zombies ThrillKill says he has implemented.

    I am not asking for the complete zombie solution. Just a player following “anything” with an animation, that would help me a lot.

    Can someone help with this?
     
  20. Fictional

    Fictional

    Joined:
    May 19, 2014
    Posts:
    2
    Thanks but It's not work. :( I still have the same problem. :confused:
     
  21. ik_jolan

    ik_jolan

    Joined:
    Jul 26, 2013
    Posts:
    15
    Hi, I have a script to open doors by pressing 'e' in c#
    problem is, the rotation of the doors aren't server sync so you'll only see the open door in the client
    I tried adding PhotonNetwerk. before transform but it gave the error PhotonNetwork. doens't fit in that context.
    My question is: how can I make the rotation server sync?

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. //Instruction:
    5. //Make an empty game object and call it "Door"
    6. //Rename your 3D door model to "Body"
    7. //Parent a "Body" object to "Door"
    8. //Make sure thet a "Door" object is in left down corner of "Body" object. The place where a Door Hinge need be
    9. //Add a box collider to "Door" object and make it much bigger then the "Body" model, mark it trigger
    10. //Assign this script to a "Door" game object that have box collider with trigger enabled
    11. //Press "e" (Default) to open and close the door
    12. //Make sure the main character is tagged "player"
    13.  
    14. public class open_door : MonoBehaviour
    15. {
    16.     public float smooth = (float)2.0;
    17.     public float DoorOpenAngle = (float)110.0;
    18.     public float DoorCloseAngle = (float)0.0;
    19.     public bool open = false;
    20.     public bool enter = false;
    21.      string defined_key = "E";
    22.    
    23.     // Update is called once per frame
    24.     void Update ()
    25.     {
    26.         if(open == true)
    27.         {
    28.             var target = Quaternion.Euler (transform.localRotation.x, DoorOpenAngle, transform.localRotation.z);
    29.             // Dampen towards the target rotation
    30.             transform.localRotation = Quaternion.Slerp(transform.localRotation, target,
    31.             Time.deltaTime * smooth);
    32.         }
    33.    
    34.         if(open == false)
    35.         {
    36.             var target1 = Quaternion.Euler (transform.localRotation.x, DoorCloseAngle, transform.localRotation.z);
    37.             // Dampen towards the target rotation
    38.             transform.localRotation = Quaternion.Slerp(transform.localRotation, target1,
    39.             Time.deltaTime * smooth);
    40.         }
    41.    
    42.         if(enter == true)
    43.         {
    44.             if(Input.GetKeyDown(KeyCode.E))
    45.             {
    46.                 open = !open;
    47.             }
    48.         }  
    49.     }
    50.  
    51.     //Activate the Main function when player is near the door
    52.     void OnTriggerEnter(Collider other)
    53.     {
    54.         if (other.gameObject.tag == "Player")
    55.         {
    56.             //Debug.Log("Trigger Enter");
    57.             (enter) = true;
    58.         }
    59.     }
    60.    
    61.     //Deactivate the Main function when player is go away from door
    62.     void OnTriggerExit (Collider other)
    63.     {
    64.         if (other.gameObject.tag == "Player")
    65.         {
    66.             //Debug.Log("Trigger Exit");
    67.             (enter) = false;
    68.         }
    69.     }
    70.     //@youtube.com/user/maksimum654321
    71. }
    72.  
    73.  
     
  22. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
     
    Last edited: May 21, 2014
  23. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
    Check this out, helped me get going: http://unity3d.com/learn/tutorials/projects/stealth/enemy-ai
     
  24. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
    http://unity3d.com/learn/tutorials/projects/stealth has a lot of stuff and goes through it all
    bergzerg's http://www.burgzergarcade.com/ it's older but its all videos and you type out the code.

    Once you get the basics of C# you can plow into this code and comment as you go and once you figure out how its working, modify it or other code to work with it gets to be easy.

    This kit really is a nice example of a Multi-Player C# FPS. You can essentially dive in right away but without knowing basic C# you may struggle getting used to why/how things are done and constantly facing roadblocks.

    Thankfully, you can use Google to search for the things you want to create and most of the time you will find examples of scripts snippets you can then custom to your use. If not you can post and ask about it. Careful not ask for outright scripts though, it's sorta in-proper manners but most people will offer up examples.

    There are a lot of clones of this kit passed off on the net calling themselves actual games, yet they are nothing more then the in game text changed or some maps added.
     
    Last edited: May 21, 2014
  25. Glentved

    Glentved

    Joined:
    Oct 30, 2013
    Posts:
    10
    Thank you for the help, and sorry for me not being clear enough.
    I do not need an example of an AI, but a simple photon network example of npc´s with synchronized animations.
     
  26. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
    Well if your really wanting to fast track yourself into getting visual examples and scripts of basically everything most people want to do, ie. Login/Register, NGUI, AI, Skills, Quests, Inventory, Loading/Saving, Multiplayer, PhotonNetworking (AI/MOB/NPC/ITEMS) etc and don't mind spending some money to do this, zerano-unity3d.com/RPGKit/rpg-kit-2-0/ will give you everything and more to to see in all in action with sourcecode. It's a pretty complete kit with basically everything but its an RPG kit not FPS kit, however if you take out the gameplay the rest stands on its own. And infact this is proven by the creator selling parts of this kit as individual pieces on the asset store.
     
    Last edited: May 21, 2014
  27. Glentved

    Glentved

    Joined:
    Oct 30, 2013
    Posts:
    10
    Thank you for the help. I will look at it, maybe RPG kit will be a better starting point for me
     
  28. johnson07

    johnson07

    Joined:
    Oct 10, 2013
    Posts:
    15
    anyone have any idea how to make the "killcam" ... I mean that the camera ragdoll, follow the player to kill us ...

    any idea would greatly appreciate it.:)
     
  29. GameDev_John

    GameDev_John

    Joined:
    May 28, 2012
    Posts:
    19
    Hey guys, decided to see what would happen with the debug monitor on for a run. I have noticed this error but when I check the code it has it correctly in. Here's the error "Asynchronous Background loading is only supported in Unity Pro.
    Please use Application.LoadLevel or Application" its for the connect menu in line 321
    Code (csharp):
    1. IEnumerator LoadMap(string sceneName){
    2.         connectingToRoom = true;
    3.         PhotonNetwork.isMessageQueueRunning = false;
    4.         fadeDir = 1;
    5.         yield return new WaitForSeconds(1);
    6.  
    7.    
    8.         AsyncOperation async = Application.LoadLevelAsync(sceneName);    
    9.         yield return async;
    10.         Debug.Log("Loading complete");  
    11.     }
    I have also noticed that I cannot return to the main menu after connecting to a room, I believe that could be related to the problem above though.
    Thanks!
     
  30. Steve-of-Construction

    Steve-of-Construction

    Joined:
    Jan 26, 2013
    Posts:
    67
    The code you're using is written for Unity PRO.
    You can use it with the FREE version with these simple changes:

    Code (csharp):
    1. IEnumerator LoadMap(string sceneName){
    2.         connectingToRoom = true;
    3.         PhotonNetwork.isMessageQueueRunning = false;
    4.         fadeDir = 1;
    5.         yield return new WaitForSeconds(1);
    6.        
    7.         // *** This is for Unity PRO only !
    8.         // AsyncOperation async = Application.LoadLevelAsync(sceneName);    
    9.         // yield return async;
    10.  
    11.         // *** This is for Unity FREE !
    12.         Application.LoadLevel(sceneName);
    13.         Debug.Log("Loading complete");  
    14. }
     
  31. GameDev_John

    GameDev_John

    Joined:
    May 28, 2012
    Posts:
    19
    Thanks for the help, I can't believe I missed it!
     
  32. GameDev_John

    GameDev_John

    Joined:
    May 28, 2012
    Posts:
    19
    Still having a slight problem when the player cannot load back to the main menu from a game in progress, any ideas? it reverts to the loading screen but fails to load. I haven't seen any problems with the debug while open. Thanks for the help again!
     
  33. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80

    Hey dunno if your still having this problem but I was redoing this script and when I saw this it made me remember your post about your problem and thought I'd share it.

    Script: PlayerNetworkController.cs


    Code (csharp):
    1.         //Check if this player from our team (if so, disable hit damage)
    2.                 if(playerTeam == (string)PhotonNetwork.player.customProperties["TeamName"]){
    3.                     playerDamage.disableDamage = true;
    This may be where it all goes wrong
     
  34. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
    Mod to add Spent Shell Casings

    In WeaponScript.cs

    Add this in the delcaration spot

    Code (csharp):
    1. // Shell Casings Settings //
    2.     [System.Serializable]
    3.     public class ShellCase {
    4.         public GameObject shellCasePrefab; // Prefab of the spent shell casing
    5.         public Vector3 EjectDirection = new Vector3(1, 1, 1);   // direction of ejected shell casing
    6.         public float Scale = 1.0f;                      // scale of ejected shell casings
    7.         public float EjectVelocity = 0.2f;              // velocity of ejected shell casing
    8.         public float EjectDelay = 0.0f;             // sets a delay before ejecting shell
    9.         public float EjectSpin = 0.0f;                  // amount of angular rotation of the shell upon spawn
    10.     }
    11.     public ShellCase shellCase;
    12. public Transform EjectPoint; // This is where spent shell casings are spawned
    13.  

    Add to Script: WeaponScript.cs
    Where: Somewhere above:
    Code (csharp):
    1. /////////////////////////////////////////////////KNIFE FUNCTIONS///////////////////////////////////
    What:
    Code (csharp):
    1.     /// <summary>
    2.     /// Instantiates a spent bullet casing, apply forces to send it in motion
    3.     /// </summary>
    4.     void EjectShellCasing () {
    5.         // If no prefab set then do nothing
    6.         if (shellCase.shellCasePrefab == null) { return; }
    7.         GameObject shellCasing = null; // Create onject for a reference of the shell prefab //
    8.         shellCasing = (GameObject)Instantiate (shellCase.shellCasePrefab, EjectPoint.position, transform.parent.rotation); // Spawn the shell //
    9.         shellCasing.transform.localScale = new Vector3 (shellCase.Scale, shellCase.Scale, shellCase.Scale); // Adjust the shellsize to scale that was set //
    10.         // This will set the empty shell in motion //
    11.         if (shellCasing.rigidbody) {           
    12.             Vector3 useTheForceJedi = (transform.TransformDirection(shellCase.EjectDirection) * shellCase.EjectVelocity);
    13.             shellCasing.rigidbody.AddForce(useTheForceJedi, ForceMode.Impulse);
    14.         }      
    15.         // This causes the shell to inherit the current speed of the controller //
    16.         if (controller) {          
    17.             Vector3 useTheForceSith = (controller.velocity);
    18.             shellCasing.rigidbody.AddForce(useTheForceSith, ForceMode.VelocityChange);
    19.         }      
    20.         // This adds the spin speed that was set in inspector //
    21.         if (shellCase.EjectSpin > 0.0f) {
    22.             if (Random.value > 0.5f)
    23.                 shellCasing.rigidbody.AddRelativeTorque(-Random.rotation.eulerAngles * shellCase.EjectSpin);
    24.             else
    25.                 shellCasing.rigidbody.AddRelativeTorque(Random.rotation.eulerAngles * shellCase.EjectSpin);
    26.         }      
    27.     }
    Then,

    In Script: WeaponScriptEditor.cs
    Where: somewhere above:
    Code (csharp):
    1. if(script.GunType == WeaponScript.gunType.KNIFE)
    What:
    Code (csharp):
    1.         // Spent Shell Casings
    2.         if(script.GunType == WeaponScript.gunType.SHOTGUN || script.GunType == WeaponScript.gunType.MACHINE_GUN) {
    3.             EditorGUILayout.LabelField("", "Spent Shell properties", "button");
    4.             script.shellCase.shellCasePrefab = EditorGUILayout.ObjectField(" Shell Casing Prefab:", script.shellCase.shellCasePrefab, typeof(UnityEngine.GameObject), allowSceneObjects) as UnityEngine.GameObject;
    5.             script.EjectPoint = EditorGUILayout.ObjectField(" Eject Point:", script.EjectPoint, typeof(UnityEngine.Transform), allowSceneObjects) as UnityEngine.Transform;
    6.             script.shellCase.EjectDirection = EditorGUILayout.Vector3Field(" Eject Direction:", script.shellCase.EjectDirection);
    7.             script.shellCase.Scale = EditorGUILayout.FloatField(" Scale:  ", script.shellCase.Scale);
    8.             script.shellCase.EjectVelocity = EditorGUILayout.Slider(" Eject Velocity:  ", script.shellCase.EjectVelocity, 1, 10);
    9.             script.shellCase.EjectDelay = EditorGUILayout.Slider(" Eject Delay:  ", script.shellCase.EjectDelay, 1, 5);
    10.             script.shellCase.EjectSpin = EditorGUILayout.Slider(" Eject Spin:  ", script.shellCase.EjectSpin, 1, 10);
    11.         }
     
    Last edited: May 28, 2014
  35. Tecknowolf01

    Tecknowolf01

    Joined:
    Oct 31, 2012
    Posts:
    49
    Great package, looks like what I think I need. One question though. I am not actually making a FPS game but rather a car combat game, but having scoreboard, team selection, map selection, multiplayer setup, and more should be very useful.

    Do you see any issues with integrating your game package into a game style like mine?
    Thanks!!
     
  36. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
    There's no problem. This kit = just add vehicles and your player/vehicle controller/camera scripts. The script that runs the lobby and room GUI's can easily be modified if not discarded and rewritten for whatever setup you want.

    example -> co-op mode -> massive map -> zombies (can have them drop items etc on death or can do same for boxes crates chests whatever) -> NPC interaction AI Hostile/Friendly -> motorcycles (or other vehicles) to travel around -> score/exp/achievement based

    This kit is highly customizable, code is easy enough to modify to whatever purpose, the FPS team deathmatch and deathmatch modes are merely a showcase of the kits versatility in my opinion.
     
  37. Tecknowolf01

    Tecknowolf01

    Joined:
    Oct 31, 2012
    Posts:
    49
    Excellent, thanks for the reply and the good news. I will let you know how things go.
    Thanks!
     
  38. Smartline-Games

    Smartline-Games

    Joined:
    Aug 15, 2013
    Posts:
    67
    Dear NSDesign-Games,

    To be honest: The following thing is a bit weird.
    I saw that you uploaded a video on Youtube on date: 16th of March 2014.


    So, I was wondering. I guess you're using this FPS Kit 2.0 for this game, but why didn't you brought any vehicle support to THIS kit?
    If you would do that, I'm pretty sure to buy it then.

    I hope to hear from you as soon as possible
     
  39. KingofMk98

    KingofMk98

    Joined:
    Oct 10, 2013
    Posts:
    63
    im guessing because this kit is suppose to help you start a game and not just have you drag and drop stuff and call it a game. Warmerise is his game and he isnt going to give you everything custom from his game to use in yours. If I were you, I would start learning how to script if you are seriously going to make a game.
     
    Last edited: May 30, 2014
  40. Smartline-Games

    Smartline-Games

    Joined:
    Aug 15, 2013
    Posts:
    67
    "Ow, hold on there sir!"

    You understood me wrong. I meant that he (NSDesignGames) should but up a tutorial (.pdf document) on how to create and set up a vehicle. Just a simple one where you can sit in, and ride with it. No turrets or any other attached weapons to it. It was just a suggestion
     
  41. ThomasJoseph315

    ThomasJoseph315

    Joined:
    Oct 18, 2013
    Posts:
    3
    Greetings,

    I bough this pack last septish, I never used it because it had chat bugs and I couldn't figure out to fix it. I seen you have released an update to fix that. Where would I obtain that update?

    Also, when I make new maps the bullet holes don't instantiate, how do I make that work?

    Also,.. only the grenades and rocket launchers can kill atm. How do I fix?

    Thanks!
     
    Last edited: May 31, 2014
  42. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
    1. Can download from the asset store as long as you login with the account that purchased it.
    2. Your really asking this question? It's because when you make new maps if you look at the code it's based on TAG's. So you need to set those up on all the objects in the map and tell it what type to instantiate. IE Metal Dirt Concrete whatever...
    3. It's because you don't have the "Remote" tag.
     
  43. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80


    It actually looks more like a modified version of this kit: https://www.assetstore.unity3d.com/en/#!/content/17070
     
  44. ThomasJoseph315

    ThomasJoseph315

    Joined:
    Oct 18, 2013
    Posts:
    3
    Yes I am really asking this question because while I understand how tags are used, the bullets after fiddling with it don't recognize box collidors, and further more the scene i had has lights connected to the objects disrupting the bullet path. And I did figure out the remote tag deal as well.

    Also,.. I have a snafu with my account. When I bough this I was under my old E-mail address. I did log in and get the update, so that is solved, but does anyone know how to update your e-mail address?
     
    Last edited: Jun 1, 2014
  45. Krisis-9

    Krisis-9

    Joined:
    Jun 2, 2014
    Posts:
    2
    Hello, when I try to add these changes it gives me this error;
    Assets/FPS Kit 2.0 C#/_CustomAssets/Scripts/FPScontroller/FPScontroller.cs(469,52): error CS1501: No overload for method `ApplyFallDamage' takes `1' arguments... yet I haven't edited anything related to the FPScontroller, I've setup everything correctly but it still won't work.
     
  46. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80


    Take note kids, this is why you don't just copy and paste code that you have no idea how it's working or what it's doing. You have copy and pasted everything correctly, but you need to fix the other logic that you broke doing the copy and paste. Fix your ApplyFallDamage to match the changes, Search the forums your answer is in there and you can copy and paste that too without needing to understand the code.
     
  47. Frezno

    Frezno

    Joined:
    Nov 21, 2012
    Posts:
    3
    Hi, can I get help with this.
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. RoomMultiplayerMenu.Awake () (at Assets/FPS Kit 2.0 C#/_CustomAssets/Scripts/Network/RoomMultiplayerMenu.cs:113)
    3. UnityEditor.DockArea:OnGUI()
    4.  
    not sure what i tmeans but i dont see in game menu nomore an cant spawn in map now, i didnt change ny code it just stop working


    Edit: now it shows this error ??

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. RoomMultiplayerMenu.Awake () (at Assets/FPS Kit 2.0 C#/_CustomAssets/Scripts/Network/RoomMultiplayerMenu.cs:102)
    3. UnityEditor.DockArea:OnGUI()
    4.  
    it says error is at
    Code (csharp):
    1. enableHelper = GameObject.FindWithTag("EnableHelper").gameObject;

    nevermind fixed by deleting findobjectwithtag and replacing it by declaring the enbablehelper gameobject.
     
    Last edited: Jun 4, 2014
  48. Krisis-9

    Krisis-9

    Joined:
    Jun 2, 2014
    Posts:
    2
    Well thanks for the helpful response. I do understand what it is doing. If a hitbox got hit (in this case the headshot hitbox) it sends the message to the whokillwho and shows it on the screen. Same with the weaponscript, it is sending the name of the weapon to the whokillwho. I did try to fix it myself but all I could do is to get more and more errors so I thought I was doing something wrong. But I understand if you don't want to help me.

    I believe it's because you haven't assigned tag Remote to your project.
     
  49. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Hey Krisis-9,
    ThrillKill has been answered your question on page 79:
    http://forum.unity3d.com/threads/fps-kit-version-2-0.153337/page-79
    The problem is that having almost zero knowlage in scripting(based on your question), you are lazy to read the forum
     
    Last edited: Jun 3, 2014
  50. ThrillKill

    ThrillKill

    Joined:
    Apr 7, 2014
    Posts:
    80
    JETPACK // SUPERJUMP

    Searching around wasn't much on the subject with an example so I got together this.

    Is this a jetpack or superjump? You Decide. This is in it's basic form. Pretty sure I got all the snippets from the scripts. Only these 2 involved. Utilized the already basic class structure and variables of how this kit already is setup to be easier to implement and customize. Feel free to modify it and make it better and don't be afraid to share it ;)


    In script: FPSinput.cs
    Underneath the Prone input add
    Code (csharp):
    1.         // Jetpack ON Input
    2.         motor.inputJetpack = Input.GetKeyDown(KeyCode.J);

    In script: FPScontroller.cs

    Above:
    Code (csharp):
    1. public class FPScontrollerJumping {
    Add this
    Code (csharp):
    1. // Jetpack Controller System //
    2.     [System.Serializable]
    3.     public class FPScontrollerJetpack {
    4.         //Cant jet unless friction isnt engaged
    5.         public bool friction = false;
    6.         public bool enabled  = true; // Can the player use a Jetpack
    7.         public bool jetting = true; // Is the player currently in motion with the jetpack
    8.         public float force = 50.0f; // How much force is applied by using the jetpack
    9.         public float perpAmount = 0.0f; // 0 means a fully vertical thrust and 1 means fully perpendicular.
    10.            
    11.         [System.NonSerialized]
    12.         public bool holdingJetpackButton = false; // Is the player holding down the jetpack button
    13.         // the time we used jetpack at (Used to determine for how long to apply jetpack power after using jetpack button.)
    14.         [System.NonSerialized]
    15.         public float lastStartTime = 0.0f;    // Last time the jetpack was used (can be used later for fuel)    
    16.         [System.NonSerialized]
    17.         public float lastButtonDownTime = -100.0f;    // Time that needs to pass before we can do another jetpack burst    
    18.         [System.NonSerialized]
    19.         public Vector3 ThrustDirection = Vector3.up;    // Shoot the player upwards
    20.     }
    21.     public FPScontrollerJetpack jetpack = new FPScontrollerJetpack();
    22.     // Jetpack Controller System //

    in
    Code (csharp):
    1. void UpdateFunction () {
    Overwrite this logic:
    Code (csharp):
    1.  if (movement.enableGravity) {
    With:
    Code (csharp):
    1.         // Jetpack Activation //
    2.         // If Input is Gravity related (Jump/Jetpack)
    3.         if (movement.enableGravity) {
    4.             if ((prone || crouch) && inputJump){ return; }
    5.                 // Apply gravity and jumping force
    6.                 velocity = ApplyGravityAndJumping (velocity);
    7.             if (inputJetpack) {
    8.                 // Apply gravity changes Jetpack Force
    9.                 velocity = ApplyGravityAndJetpack (velocity);
    10.             }
    11.         }
    12.         // Jetpack Activation //

    then above this:
    Code (csharp):
    1. Vector3 ApplyGravityAndJumping (Vector3 velocity) {
    Add:
    Code (csharp):
    1. // Jetpack Velocity and Movement //
    2.     Vector3 ApplyGravityAndJetpack (Vector3 velocity) {
    3.         if (inputJetpack || !canControl) {
    4.             jetpack.holdingJetpackButton = false;
    5.             jetpack.lastButtonDownTime = -100;
    6.         }
    7.  
    8.         if (inputJetpack && jetpack.lastButtonDownTime < 0 && canControl)
    9.             jetpack.lastButtonDownTime = Time.time;
    10.        
    11.         if (grounded)
    12.             velocity.y = Mathf.Min(0, velocity.y) - movement.gravity * Time.deltaTime;
    13.         else {
    14.             velocity.y = movement.velocity.y - movement.gravity * Time.deltaTime;
    15.             // When using the jetpack we don't apply gravity for some time when the user is holding the jetpack button.
    16.             // This gives more control over inital height and potential fuel usage
    17.             if (jetpack.jetting && jetpack.holdingJetpackButton) {
    18.                 // Calculate the duration that the jetpackbutton has been held down
    19.                 // If we're still less than that duration after the jetpack time, apply the force
    20.                 // This again can be used for a fuelsystem
    21.                 if (Time.time < jetpack.lastStartTime / CalculateJetpackVerticalSpeed(jetpack.force)) {
    22.                     // Negate the gravity we just applied, except we thrust the charactor in ThrustDirection
    23.                     velocity += jetpack.ThrustDirection * movement.gravity * Time.deltaTime;
    24.                    }
    25.             }                
    26.             // Make sure we don't fall any faster than maxFallSpeed. This gives our character a terminal velocity.
    27.             velocity.y = Mathf.Max (velocity.y, -movement.maxFallSpeed);
    28.         }
    29.            
    30.      
    31.         if (jetpack.enabled && canControl && (Time.time - jetpack.lastButtonDownTime < 0.2)) {
    32.             grounded = false;
    33.             jetpack.jetting = true;
    34.             jetpack.lastStartTime = Time.time;
    35.             jetpack.lastButtonDownTime = -100;
    36.             jetpack.holdingJetpackButton = true;
    37.             jetpack.ThrustDirection = Vector3.Slerp(Vector3.up, groundNormal, jetpack.perpAmount);
    38.             // Apply the jetpack force to the velocity. Cancel any vertical velocity first.
    39.             velocity.y = 0;
    40.             velocity += jetpack.ThrustDirection * CalculateJetpackVerticalSpeed (jetpack.force);
    41.            
    42.             SendMessage("OnJetpack", SendMessageOptions.DontRequireReceiver); // Tells the other methods         player is using the jetpack
    43.         } else {
    44.             jetpack.holdingJetpackButton = false; // Player is not holding the jetpack button
    45.            
    46.         }            
    47.         return velocity;
    48.     }
    49.  
    50.     public float CalculateJetpackVerticalSpeed (float targetJetpackForce) {
    51.         // From the jetpack and gravity we deduce the upwards speed
    52.         // for the character to reach at the apex.
    53.         return Mathf.Sqrt (2 * targetJetpackForce * movement.gravity);
    54.     }
    55.     // Jetpack Velocity and Movement //
     
    Last edited: Jun 4, 2014
    jpwits and Le_Hieu like this.