Search Unity

FPS Kit | Version 2.0

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

  1. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Same idea use the following line to create the network object:
    Health = PhotonNetwork.Instantiate(HealthBox.name, position, rotation, 0);
     
  2. ik_jolan

    ik_jolan

    Joined:
    Jul 26, 2013
    Posts:
    15
    Awesome! thanks
     
  3. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Hi Stan, done all that and i still cant see the minimap and now cant even view the worldmap when i press M :(
     
  4. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Try with bunker scene and NJG MiniMap (3D) - it should work,I've tested with empty project yesterday
     
  5. BL Studios

    BL Studios

    Joined:
    Feb 18, 2014
    Posts:
    11
    Hi @Stan B.

    could you help me with something simple please.

    I just want to add animation "Fire" and "reload" the script "CharacterAnimacion"
    but I can not make it work ...

    Code (csharp):
    1. //NSdesignGames @ 2012
    2. //FPS Kit | Version 2.0 + Multiplayer
    3.  
    4. //Use this script to controll thrird person animation
    5.  
    6. #pragma strict
    7.  
    8. import System.Collections.Generic;
    9.  
    10. //@script ExecuteInEditMode
    11.  
    12. //Use this gameObject to send messages to AnimationSync.cs
    13. var animationSyncHelper : GameObject;
    14. var animationForHands : GameObject;
    15. var activeWeapon : GameObject; //This gameObject.name will tell PlayerNetworkController.cs which third person weapon is active now
    16. var animationType : GameObject; //Object that will send current animation type to PlayerNetworkController.cs
    17. enum Action{Stand, Crouch, Prone}
    18. var weaponManager : WeaponManager;
    19. private var action : Action;
    20.  
    21. class animations{
    22.     //Edit pose
    23.     //var poseAnimation : AnimationClip;
    24.     //Idle animations
    25.     var jumpPose : AnimationClip;
    26.     var stayIdle : AnimationClip;
    27.     var crouchIdle : AnimationClip;
    28.     var proneIdle : AnimationClip;
    29.     //Walk Animations
    30.     var walkFront : AnimationClip;
    31.     var walkBack : AnimationClip;
    32.     var walkLeft : AnimationClip;
    33.     var walkRight : AnimationClip;
    34.     //Run animations
    35.     var runFront : AnimationClip;
    36.     //Crouch animations
    37.     var crouchFront : AnimationClip;
    38.     var crouchLeft : AnimationClip;
    39.     var crouchRight : AnimationClip;
    40.     var crouchBack : AnimationClip;
    41.     //Prone Animations
    42.     var proneFront : AnimationClip;
    43.     var proneLeft : AnimationClip;
    44.     var proneRight : AnimationClip;
    45.     var proneBack : AnimationClip;
    46.     //Weapon animations
    47.     var pistolIdle : AnimationClip;
    48.     var knifeIdle : AnimationClip;
    49.     var gunIdle : AnimationClip;
    50.     var fire : AnimationClip; //these animations
    51. var reload : AnimationClip;
    52. }
    53.  
    54. var Animations : animations;
    55.  
    56. var twoHandedWeapons : List.<WeaponScript>;
    57. var pistols : List.<WeaponScript>;
    58. var knivesNades : List.<WeaponScript>;
    59.  
    60. private var fpsController : FPScontroller;
    61.  
    62. function Start () {
    63.     fpsController = transform.root.GetComponent.<FPScontroller>();
    64.     configureAnimations();
    65.     if(weaponManager){
    66.         ThirdPersonWeaponControl();
    67.     }
    68. }
    69.  
    70. function LateUpdate () {
    71.     if(weaponManager.SelectedWeapon){
    72.         activeWeapon.name = weaponManager.SelectedWeapon.weaponName;
    73.     }
    74.     if(!fpsController.crouch  !fpsController.prone){
    75.         action = Action.Stand;
    76.     }else{
    77.         if(fpsController.crouch  !fpsController.prone){
    78.             action = Action.Crouch;
    79.         }
    80.         if(!fpsController.crouch  fpsController.prone){
    81.             action = Action.Prone;
    82.         }
    83.         if(fpsController.crouch  fpsController.prone){
    84.             action = Action.Crouch;
    85.         }
    86.     }
    87.    
    88.     if(action == Action.Stand){
    89.         if(fpsController.grounded){
    90.             if(fpsController.Walking){
    91.                 if(!fpsController.Running){
    92.                     animationType.name = "Walking";
    93.                     if( Input.GetKey(KeyCode.W)){
    94.                         animation.CrossFade(Animations.walkFront.name, 0.2);
    95.                         //Send animation name (needed for multiplayer)
    96.                         animationSyncHelper.name = Animations.walkFront.name;
    97.                     }
    98.                     else if(Input.GetKey(KeyCode.A)  !Input.GetKey(KeyCode.S)){
    99.                         animation.CrossFade(Animations.walkLeft.name, 0.2);
    100.                         //Send animation name (needed for multiplayer)
    101.                         animationSyncHelper.name = Animations.walkLeft.name;
    102.                     }
    103.                     else if( Input.GetKey(KeyCode.D)  !Input.GetKey(KeyCode.S)){
    104.                         animation.CrossFade(Animations.walkRight.name, 0.2);
    105.                         //Send animation name (needed for multiplayer)
    106.                         animationSyncHelper.name = Animations.walkRight.name;
    107.                     }
    108.                     else if(Input.GetKey(KeyCode.S)){
    109.                         animation.CrossFade(Animations.walkBack.name, 0.2);
    110.                         //Send animation name (needed for multiplayer)
    111.                         animationSyncHelper.name = Animations.walkBack.name;
    112.                     }
    113.                 }else{
    114.                     animationType.name = "Running";
    115.                     if( Input.GetKey(KeyCode.W) ){
    116.                         animation.CrossFade(Animations.runFront.name, 0.2);
    117.                         //Send animation name (needed for multiplayer)
    118.                         animationSyncHelper.name = Animations.runFront.name;
    119.                     }
    120.                 }
    121.             }else{
    122.                 animation.CrossFade(Animations.stayIdle.name, 0.2);
    123.                 //Send animation name (needed for multiplayer)
    124.                 animationSyncHelper.name = Animations.stayIdle.name;
    125.             }
    126.         }else{
    127.                 animation.CrossFade(Animations.jumpPose.name, 0.2);
    128.                 //Send animation name (needed for multiplayer)
    129.                 animationSyncHelper.name = Animations.jumpPose.name;
    130.         }
    131.     }
    132.    
    133.     if(action == Action.Crouch){
    134.         animationType.name = "Crouch";
    135.         if(fpsController.Walking ){
    136.             if( Input.GetKey(KeyCode.W) ){
    137.                 animation.CrossFade(Animations.crouchFront.name, 0.2);
    138.                 //Send animation name (needed for multiplayer)
    139.                 animationSyncHelper.name = Animations.crouchFront.name;
    140.             }
    141.             else if(Input.GetKey(KeyCode.A)  !Input.GetKey(KeyCode.S)){
    142.                 animation.CrossFade(Animations.crouchLeft.name, 0.2);
    143.                 //Send animation name (needed for multiplayer)
    144.                 animationSyncHelper.name = Animations.crouchLeft.name;
    145.             }
    146.             else if( Input.GetKey(KeyCode.D)  !Input.GetKey(KeyCode.S)){
    147.                 animation.CrossFade(Animations.crouchRight.name, 0.2);
    148.                 //Send animation name (needed for multiplayer)
    149.                 animationSyncHelper.name = Animations.crouchRight.name;
    150.             }
    151.             else if(Input.GetKey(KeyCode.S)){
    152.                 animation.CrossFade(Animations.crouchBack.name, 0.2);
    153.                 //Send animation name (needed for multiplayer)
    154.                 animationSyncHelper.name = Animations.crouchBack.name;
    155.             }
    156.         }else{
    157.             animation.CrossFade(Animations.crouchIdle.name, 0.2);
    158.             //Send animation name (needed for multiplayer)
    159.             animationSyncHelper.name = Animations.crouchIdle.name;
    160.         }
    161.     }
    162.     if(action == Action.Prone){
    163.         animationType.name = "Prone";
    164.         if(fpsController.Walking ){
    165.             if( Input.GetKey(KeyCode.W) ){
    166.                 animation.CrossFade(Animations.proneFront.name, 0.2);
    167.                 //Send animation name (needed for multiplayer)
    168.                 animationSyncHelper.name = Animations.proneFront.name;
    169.             }
    170.             else if(Input.GetKey(KeyCode.A)  !Input.GetKey(KeyCode.S)){
    171.                 animation.CrossFade(Animations.proneLeft.name, 0.2);
    172.                 //Send animation name (needed for multiplayer)
    173.                 animationSyncHelper.name = Animations.proneLeft.name;
    174.             }
    175.             else if( Input.GetKey(KeyCode.D)  !Input.GetKey(KeyCode.S)){
    176.                 animation.CrossFade(Animations.proneRight.name, 0.2);
    177.                 //Send animation name (needed for multiplayer)
    178.                 animationSyncHelper.name = Animations.proneRight.name;
    179.             }
    180.             else if(Input.GetKey(KeyCode.S)){
    181.                 animation.CrossFade(Animations.proneBack.name, 0.2);
    182.                 //Send animation name (needed for multiplayer)
    183.                 animationSyncHelper.name = Animations.proneBack.name;
    184.             }
    185.         }else{
    186.             animation.CrossFade(Animations.proneIdle.name, 0.2);
    187.             //Send animation name (needed for multiplayer)
    188.             animationSyncHelper.name = Animations.proneIdle.name;
    189.         }
    190.     }
    191.     ThirdPersonWeaponControl();
    192. }
    193.  
    194. function ThirdPersonWeaponControl(){
    195.     if(action != Action.Prone){
    196.         if(twoHandedWeapons.Contains(weaponManager.SelectedWeapon)){
    197.             animationForHands.name = Animations.gunIdle.name;
    198.         }
    199.         else if(pistols.Contains(weaponManager.SelectedWeapon)){
    200.             animationForHands.name = Animations.pistolIdle.name;
    201.         }
    202.         else if(knivesNades.Contains(weaponManager.SelectedWeapon)){
    203.             animationForHands.name = Animations.knifeIdle.name;
    204.         }
    205.     }else{
    206.         animationForHands.name = "Null";
    207.     }
    208. }
    209.  
    210. function configureAnimations(){
    211.     //Set animations Wrap Mode and Speed
    212.     if(Animations.stayIdle){
    213.         animation[Animations.stayIdle.name].wrapMode = WrapMode.Loop;
    214.     }
    215.     if(Animations.crouchIdle){
    216.         animation[Animations.crouchIdle.name].wrapMode = WrapMode.Loop;
    217.     }
    218.     if(Animations.proneIdle){
    219.         animation[Animations.proneIdle.name].wrapMode = WrapMode.Loop;
    220.     }
    221.     if(Animations.walkFront){
    222.         animation[Animations.walkFront.name].wrapMode = WrapMode.Loop;
    223.         //animation[Animations.walkFront.name].speed = Animations.walkAnimationsSpeed;
    224.     }
    225.     if(Animations.walkBack){
    226.         animation[Animations.walkBack.name].wrapMode = WrapMode.Loop;
    227.         //animation[Animations.walkBack.name].speed = Animations.walkAnimationsSpeed;
    228.     }
    229.     if(Animations.walkLeft){
    230.         animation[Animations.walkLeft.name].wrapMode = WrapMode.Loop;
    231.         //animation[Animations.walkLeft.name].speed = Animations.walkAnimationsSpeed;
    232.     }
    233.     if(Animations.walkRight){
    234.         animation[Animations.walkRight.name].wrapMode = WrapMode.Loop;
    235.         //animation[Animations.walkRight.name].speed = Animations.walkAnimationsSpeed;
    236.     }
    237.     if(Animations.runFront){
    238.         animation[Animations.runFront.name].wrapMode = WrapMode.Loop;
    239.         //animation[Animations.runFront.name].speed = Animations.runAnimationsSpeed;
    240.     }
    241.     if(Animations.crouchFront){
    242.         animation[Animations.crouchFront.name].wrapMode = WrapMode.Loop;
    243.         //animation[Animations.crouchFront.name].speed = Animations.crouchAnimationsSpeed;
    244.     }
    245.     if(Animations.crouchLeft){
    246.         animation[Animations.crouchLeft.name].wrapMode = WrapMode.Loop;
    247.         //animation[Animations.crouchLeft.name].speed = Animations.crouchAnimationsSpeed;
    248.     }
    249.     if(Animations.crouchRight){
    250.         animation[Animations.crouchRight.name].wrapMode = WrapMode.Loop;
    251.         //animation[Animations.crouchRight.name].speed = Animations.crouchAnimationsSpeed;
    252.     }
    253.     if(Animations.crouchBack){
    254.         animation[Animations.crouchBack.name].wrapMode = WrapMode.Loop;
    255.         //animation[Animations.crouchBack.name].speed = Animations.crouchAnimationsSpeed;
    256.     }
    257.     if(Animations.proneFront){
    258.         animation[Animations.proneFront.name].wrapMode = WrapMode.Loop;
    259.         //animation[Animations.proneFront.name].speed = Animations.proneAnimationsSpeed;
    260.     }
    261.     if(Animations.proneLeft){
    262.         animation[Animations.proneLeft.name].wrapMode = WrapMode.Loop;
    263.         //animation[Animations.proneLeft.name].speed = Animations.proneAnimationsSpeed;
    264.     }
    265.     if(Animations.proneRight){
    266.         animation[Animations.proneRight.name].wrapMode = WrapMode.Loop;
    267.         //animation[Animations.proneRight.name].speed = Animations.proneAnimationsSpeed;
    268.     }
    269.     if(Animations.proneBack){
    270.         animation[Animations.proneBack.name].wrapMode = WrapMode.Loop;
    271.         //animation[Animations.proneBack.name].speed = Animations.proneAnimationsSpeed;
    272.     }
    273. }
    I tried something like this.

    Code (csharp):
    1. if(weaponManager.machineGun.Fire()){
    2. animation.CrossFade(Animations.fire.name, 0.2);
    3.                         //Send animation name (needed for multiplayer)
    4.                         animationSyncHelper.name = Animations.fire.name;
    5. }
    6.  
     
  6. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Did not try myself but I guess the right place for update will be in "ThirdPersonWeaponControl" like:
    Code (csharp):
    1.  
    2. function ThirdPersonWeaponControl(){
    3.     if(action != Action.Prone){
    4.         if(twoHandedWeapons.Contains(weaponManager.SelectedWeapon)){
    5.             if(Input.GetButton("Fire1")){
    6.                 animationForHands.name = Animations.fire.name;
    7.             }
    8.             else{  
    9.                 animationForHands.name = Animations.gunIdle.name;
    10.             }
    11.         }
    12. ...
    13.  
     
  7. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Hi Stan,

    I did this, but still get minimap grayed out and pressing M doesnt bring up the main map. Im a bit lost :(

    [edit]

    Ok i started from scratch. I did the following:

    1. deleted NGUI version folder, then double clicked NGUI version to recreate the folder.
    2. dragged NJG minimap (3d) into the scene, actually high up in the scene out of the way.
    3. created a layer called minimap then clicked apply.
    4. put networkplayer prefab into the scene and added mapitem script to NetworkPlayer>LookObject>Main Camera and then clicked apply and then removed the networkplayer prefab from the scene

    build the game, can now use M to see the main map, but still both maps are grayed out. I must be missing something?

    $screenshot.png
     
    Last edited: Mar 7, 2014
  8. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Hi Stan,

    Update:

    Sorted. The boundries were slightly off, and i had to click in unity to generate the map. Seems with fps kit, theres an issue with autogeneration.

    Now, do you know how to have team members appear on the map, and the other team to appear as for example all red? thanks
     
  9. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    1. Add NJGMapItem to the ExampleSoldier(fbx) and disable it(uncheck)
    2. in PlayerNetworkController.cs add declaration:

    NJGMapItem mapItem;

    3. add to Awake():
    mapItem = this.gameObject.GetComponentInChildren<NJGMapItem>();

    4. Update:
    Code (csharp):
    1.  
    2.             //Check room game mode
    3.             if(rmm.gameMode == "TDM"){
    4.                 //Check if this player from our team (if so, disable hit damage)
    5.                 if(playerTeam == (string)PhotonNetwork.player.customProperties["TeamName"]){
    6.                     playerDamage.disableDamage = true;
    7.                     drawPlayerName.enabled = true;
    8.                     if((string)PhotonNetwork.player.customProperties["TeamName"] != "Spectators")
    9.                     {
    10.                         mapItem.type = 5;
    11.                         mapItem.enabled = true;
    12.                     }
    13.                 }else{
    14.                     //But if player from other team, do nto display name
    15.                     playerDamage.disableDamage = false;
    16.                     drawPlayerName.enabled = false;
    17.                     if((string)PhotonNetwork.player.customProperties["TeamName"] != "Spectators")
    18.                     {
    19.                         mapItem.type = 2;
    20.                         mapItem.enabled = true;
    21.                     }
    22.                 }
    23.             }else{
    24.                 drawPlayerName.enabled = false;
    25.                 if((string)PhotonNetwork.player.customProperties["TeamName"] != "Spectators")
    26.                 {
    27.                     mapItem.type = 2;
    28.                     mapItem.enabled = true;
    29.                 }
    30.             }
    31.  
     
  10. serega990306

    serega990306

    Joined:
    Nov 2, 2013
    Posts:
    9
    I want to set new weapons, but i have an error

    What's wrong? What i must do?
     
  11. Master_Chief

    Master_Chief

    Joined:
    Feb 11, 2013
    Posts:
    22
    --Fixed
     
    Last edited: Mar 8, 2014
  12. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Hi stan
    that worked a treat. How do I get them onto my main map too? I cant even see my own icon on the main map :'(
     
  13. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Ok i got it working. I had to change the UI settings on the worldmap depth to 1. can see what i need. Although i dont see the skull appear on the map when someone is killed.
     
  14. thingimibob

    thingimibob

    Joined:
    Nov 1, 2013
    Posts:
    39
    Looking forward to buying looks pretty nice from the previews I've seen, graphics are great and I like the fact it has multiplayer support. :D
     
  15. serega990306

    serega990306

    Joined:
    Nov 2, 2013
    Posts:
    9
  16. sezbladex

    sezbladex

    Joined:
    Sep 15, 2013
    Posts:
    22
    Hello i add new weapon but other players dont hear weapon sound
     
  17. thingimibob

    thingimibob

    Joined:
    Nov 1, 2013
    Posts:
    39
    I bought and it is amazing (completely worth $70) I love it! :eek::D
     
  18. lifelesspizza

    lifelesspizza

    Joined:
    Mar 27, 2013
    Posts:
    5
    PLSSSSSSSS Help i have problem when i click spawn it wont spawn me a player....
     
  19. lifelesspizza

    lifelesspizza

    Joined:
    Mar 27, 2013
    Posts:
    5
    please help when i click spawn it wont spawn!! plsss help :((
     
  20. lifelesspizza

    lifelesspizza

    Joined:
    Mar 27, 2013
    Posts:
    5
    hey i fixed i cant spawn but now i have problem with slow motion when i spawn its really slow speed of game...
     
  21. Steve-of-Construction

    Steve-of-Construction

    Joined:
    Jan 26, 2013
    Posts:
    67
    There's a little bug in WeaponScript.
    If you have selected SHOTGUN and clips are empty you can anyway send a "Reload-signal" cause of existing MACHINEGUN clips!

    Fix:

    change from:
    Code (csharp):
    1.  
    2. //3.Reload input
    3. if(Input.GetKeyDown(KeyCode.R)  !isReload  machineGun.clips > 0){
    4.     if(GunType == gunType.MACHINE_GUN  machineGun.bulletsLeft != machineGun.bulletsPerClip){
    5.         StartCoroutine(machineGunReload());
    6.     }
    7.     if(GunType == gunType.SHOTGUN  ShotGun.bulletsLeft != ShotGun.bulletsPerClip){
    8.         StartCoroutine(shotGunReload());
    9.     }
    10. }
    to new code:
    Code (csharp):
    1.  
    2. //3.Reload input
    3. if(Input.GetKeyDown(KeyCode.R)  !isReload){
    4.     if(GunType == gunType.MACHINE_GUN   machineGun.clips > 0){
    5.         if(GunType == gunType.MACHINE_GUN  machineGun.bulletsLeft != machineGun.bulletsPerClip){
    6.             StartCoroutine(machineGunReload());
    7.         }
    8.     }
    9.            
    10.     if(GunType == gunType.SHOTGUN  ShotGun.clips > 0){
    11.         if(GunType == gunType.SHOTGUN  ShotGun.bulletsLeft != ShotGun.bulletsPerClip){
    12.             StartCoroutine(shotGunReload());
    13.         }      
    14.     }      
    15. }
     
  22. Steve-of-Construction

    Steve-of-Construction

    Joined:
    Jan 26, 2013
    Posts:
    67
    post deleted
     
    Last edited: Mar 12, 2014
  23. EddieChristian

    EddieChristian

    Joined:
    Oct 9, 2012
    Posts:
    725
    Can this be used with Photon Pun+??
     
  24. Sickleadz

    Sickleadz

    Joined:
    Jan 24, 2014
    Posts:
    16
    Hi i have a question..

    I got some really annoying network problems, and have now tested this asset on 3 computers, and get the same issue!
    After installing a the asset (FRESH) Everything runs fine after build i can play and everything, it just runs as it should,
    BUT! after i restart unity opening the same exact projects, and Rebuild the game, i Can enter the game as before,
    But the Players are frozen?!? standing in T- Position, Like there is a sync problem? RPC Bug?? whatever...

    This happends everytime, and i have not touched any scripts or anything, the only thing i tried is adding my own Photon APP ID, but the problem is the same..

    I could really need an explanation of these, it is really weird....

    Thanks in advance!...

    Does any other have this problem? or am i doing something wrong...

    I've attach a screenshot ingame...

    $whatinthefck.jpg
     
  25. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hey,

    Make sure your project contain tag "Remote". If not, add it manually to tag list.
     
  26. midorina

    midorina

    Joined:
    Jun 1, 2012
    Posts:
    131
    Just wondering if you are going to support Mechanim in a future update? That would be very awesome and help complete the kit if it was supported. I have recently purchased Mechanim animations and wish to use them with the kit. Please let me know.

    Cheers!
     
  27. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Hello,

    I signed up to photon, using my email address to get a free 20ccu account. When i build my game, i can see other people have created rooms in the lobby, but obviously they dont have my client.

    Is that normal with a free photon account?
     
  28. applideveloper

    applideveloper

    Joined:
    Mar 17, 2014
    Posts:
    1
    I bought FPS Kit | Version 2.0 - Multiplayer yesterday, but I can't play the multiplayer mode.
     
  29. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Did you make sure to enter your App ID into the Photon settings in Unity?
     
  30. skullptor

    skullptor

    Joined:
    Nov 2, 2012
    Posts:
    48
    Hi, can you please help me?

    I put a tag "remote" and solved the T position problem,
    but the opponent animations still not working.
    the characters are still in Idle position for every movement.

    can you help me?
    thanks in advance
     
  31. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Make sure tag Remote you added is with upper case R
     
  32. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Hi,

    hm i thought i did, but added now. thanks :)
     
  33. nertworks

    nertworks

    Joined:
    Mar 6, 2014
    Posts:
    21
    I added the multiplayer prefab pickups. But the player will not pick them up. What am I doing wrong.
     
  34. nertworks

    nertworks

    Joined:
    Mar 6, 2014
    Posts:
    21
    Also Anything I add new to the GUI won't let me click on it. Is there some mask or something blocking the mouse accessing other windows? I'm referring to the Room Multiplayer cs script.
     
  35. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
  36. nertworks

    nertworks

    Joined:
    Mar 6, 2014
    Posts:
    21
  37. Amer-ALhwifi

    Amer-ALhwifi

    Joined:
    Jul 4, 2012
    Posts:
    20
    Hello Guys ,

    If i want to use the multiplayer scripts only , What are the changes that i need to do ? ( i will use my fps controller , character etc .. )

    Thanks in Advance !
     
  38. nertworks

    nertworks

    Joined:
    Mar 6, 2014
    Posts:
    21
    Nevermind I found it.
     
  39. nertworks

    nertworks

    Joined:
    Mar 6, 2014
    Posts:
    21
    You know what would be just peachy. A PDF that would explain how to add new weapons. This trial and error stuff is for the birds. Especially knowing there is someone who knows exactly how to do this out there. And that would be you NSdesignGames. I do love this asset. It is my favorite purchase so far. However, adding new weapons is a bit frustrating. Any help would be much appreciated.
     
  40. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hey,

    You can find .pdf tutorials at front post. There you will find how to setup weapon for fps view
    and another tutorial "Setup 3rd Person Character for Multiplayer" explain how to setup weapons for multiplayer part.

    Cheers!
     
  41. nertworks

    nertworks

    Joined:
    Mar 6, 2014
    Posts:
    21
    Thank you sir.
     
  42. thingimibob

    thingimibob

    Joined:
    Nov 1, 2013
    Posts:
    39
    Hi, I was just wondering how you would make it so theres a different player model for each team. So team A would have one model and team B would have another one.
     
  43. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
  44. Duxx

    Duxx

    Joined:
    Mar 22, 2014
    Posts:
    10
    Hi Stan!, This "tutorial" is for Javascript version... but now its C# and not run.

    Pls, can you update your tutorial for the new version?. Thx!
     
  45. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    You don't read the forum, page 68:
    http://forum.unity3d.com/threads/153337-FPS-Kit-Version-2-0/page68

    PS I'm noob but "noobs are back hoping somebody will make their game for them"
     
  46. Duxx

    Duxx

    Joined:
    Mar 22, 2014
    Posts:
    10
    Sorry Stan.. i dont see this page. I use the Google search and show the JS version.


    I've a problem with this.. can't change the second skin of Ragdoll, this its duplicated of the first. Can help me with this?
     
  47. thingimibob

    thingimibob

    Joined:
    Nov 1, 2013
    Posts:
    39
    Create a new tag and call it Remote hopefully that will work
     
  48. thingimibob

    thingimibob

    Joined:
    Nov 1, 2013
    Posts:
    39
    I have the same problem.
     
  49. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    i've been looking for a long time how to add Mecanim support to the 3rd person model, but lack of time and working legacy animations just stopped me to do it.
    Two days ago I found very nice script that allows for a wide variety of animation methods used by the old Legacy system for the Mecanim:
    https://www.assetstore.unity3d.com/#/content/15156

    Here is quick guide how to use it:

    1. Create Avatar for you model. Note that model included in the FPS Kit is not fully rigged and has some missing bones, so before you start, you may need to find and replace 3rd person model(NSdesignGames can you add some missing bones to the model? Just try to switch animation type from legacy to humanoid, create avatar and check what is missing)

    2 Remove Animation component from ExampleSoldier(fbx) and add Animator. Assign Avatar to the Animator

    3. Edit CharacterAnimation.cs
    - add declaration:
    MecanimControl mecanimControl;
    - add to Start()
    mecanimControl = gameObject.GetComponent<MecanimControl>();
    - Replace animation.CrossFade with mecanimControl.CrossFade
    - comment in Start() configureAnimations();

    4 Edit PlayerNetworkController.cs
    - add declaration:
    MecanimControl mecanimControl;
    AnimationData animationData;
    - add Start() function:
    Code (csharp):
    1.  
    2.     void Start () {
    3.         mecanimControl = headLookController.GetComponent<MecanimControl>();
    4.     }
    5.  
    replace Update()
    Code (csharp):
    1.  
    2.     void Update(){
    3.         playerIsOurs = photonView.isMine;
    4.         if (!photonView.isMine){
    5.             //Update remote player (smooth this, this looks good, at the cost of some accuracy)
    6.             transform.position = Vector3.Lerp(transform.position, correctPlayerPos, Time.deltaTime * 8);
    7.             transform.rotation = Quaternion.Lerp(transform.rotation, correctPlayerRot, Time.deltaTime * 8);
    8.             lookTarget.position = Vector3.Lerp(lookTarget.position, lookTargetPos, Time.deltaTime * 8);
    9.             lookTarget.rotation = lookTargetRot;
    10.            
    11.             if(gameObject.name != PlayerName){
    12.                 gameObject.name = PlayerName;
    13.             }
    14.            
    15.             //Check room game mode
    16.             if(rmm.gameMode == "TDM"){
    17.                 //Check if this player from our team (if so, disable hit damage)
    18.                 if(playerTeam == (string)PhotonNetwork.player.customProperties["TeamName"]){
    19.                     playerDamage.disableDamage = true;
    20.                     drawPlayerName.enabled = true;
    21.                 }else{
    22.                     //But if player from other team, do nto display name
    23.                     playerDamage.disableDamage = false;
    24.                     drawPlayerName.enabled = false;
    25.                 }
    26.             }else{
    27.                 drawPlayerName.enabled = false;
    28.             }
    29.            
    30.             //Player animation sync ***************************************************************************************
    31.             animationData = mecanimControl.GetAnimationData(MovementAnimation);
    32.             //Base movement animations
    33.             if(MovementAnimation != currentAnimation){
    34.                 MovementAnimation = currentAnimation;
    35.                
    36.                 animationData = mecanimControl.GetAnimationData(MovementAnimation);
    37.                
    38.                 //Set animation speed
    39.                 if(animType == "Walking"){
    40.                     animationData.speed = animationSpeed.walkSpeed;
    41.                 }
    42.                 if(animType == "Running"){
    43.                     animationData.speed = animationSpeed.runSpeed;
    44.                 }
    45.                 if(animType == "Crouch"){
    46.                     animationData.speed = animationSpeed.crouchSpeed;
    47.                 }
    48.                 if(animType == "Prone"){
    49.                     animationData.speed = animationSpeed.proneSpeed;
    50.                 }
    51.                
    52.                 //Set animation layer and wrap mode
    53.                 if(animationData != null){
    54.                     animationData.wrapMode = WrapMode.Loop;
    55.                 }
    56.             }
    57.             if(animationData != null){
    58.                 if(!mecanimControl.IsPlaying(MovementAnimation))
    59.                     mecanimControl.CrossFade(MovementAnimation, 0.2f);
    60.             }
    61.            
    62.             //Blended weapon animations (Pistol Idle, Knife Idle etc.)
    63.             //If blended animation == "Null" mean that we dont need mixing animation at the moment, so disable them
    64.             if(currentBlendedAnimation != blendedAnimation){
    65.                 currentBlendedAnimation = blendedAnimation;
    66.             }
    67.             //**********************************************************************************************************
    68.            
    69.             //Change third person weapon
    70.             if(prevWeap != currentWeaponName){
    71.                 for(int i = 0; i < thirdPersonWeapons.childCount; i++){
    72.                     if(thirdPersonWeapons.GetChild(i).name != currentWeaponName){
    73.                         thirdPersonWeapons.GetChild(i).gameObject.SetActive(false);
    74.                     }else{
    75.                         thirdPersonWeapons.GetChild(i).gameObject.SetActive(true);
    76.                         currentActiveWeapon = thirdPersonWeapons.GetChild(i).gameObject;
    77.                     }
    78.                 }
    79.                 prevWeap = currentWeaponName;
    80.             }
    81.         }
    82.     }
    83.  
    5. Assign Mecanim animations to the CharacterAnimation script
    6. Add MecanimControl.cs script to the ExampleSoldier(fbx)
    7. Assign the same Mecanim animations to the MecanimControl.cs. Add name, speed, duration and wrap mode as shown below:
    $mc.jpg

    Edit: Guys this is not the final Mecanim solution, just prove of concept. I'm not going to use it in my current project because it's almost ready to go, but I'm looking forward for the next game, and there I'm going to use Mecanim for sure. You'll find that I've simplified the update script removing "Blended weapon animations", because I do not use it in my current project and this part can be easily removed if you use Mecanim. Please try to improve it if you have interest and post your finding here, let's make FPS Kit the best solution for the multiplayer FPS.

    PS NSdesignGames - now it's your turn for the Mecanim support!
     
    Last edited: Mar 23, 2014
  50. serega990306

    serega990306

    Joined:
    Nov 2, 2013
    Posts:
    9
    Does anybody has ready scripts on new gamemods?