Search Unity

FPS Kit | Version 2.0

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

  1. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    could you share that script please
     
  2. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    P.S Sameone know how to do too Capture Point? method?
     
  3. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    I have a temporary set back where I designed a character and added it to the network, but the camera passes by him. What I mean is, when the character is moving, it seems fine at first, but then slowly the camera gets closer then soon its in front of him and still going.
    Any suggestions would be super.
     
  4. ZeoWorks

    ZeoWorks

    Joined:
    Dec 13, 2012
    Posts:
    76
    It would be great if you fix the animation sync :) For particular people it will not work. >.<
     
  5. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    If I understand right, the camera goes through player body? If so, you can scale down character model or increase Character Controller radius
     
  6. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Sorry but whats wrong with Animation Sync?
    You probably thought that because player is not moving while crouch or prone, but that not a problem with Animation Sync but lack of certain animations.
    You can easily fix the problem by replacing default soldier model with your own which have all necessary animations (Find tutorials at front post)
     
  7. ZeoWorks

    ZeoWorks

    Joined:
    Dec 13, 2012
    Posts:
    76
    Nope, for particular people, they seem to have the 'idle' animation no matter what, wither they're walking, crouching, jumping, or not; they'll always have it. Its not just my PC, everyone can see it. Of course, the head controller still works, but not the animation. (And yes, this glitch is also in your webplayer demo, sorry). :)
     
  8. maximilion96

    maximilion96

    Joined:
    May 14, 2013
    Posts:
    1
    Hello!
    We`ve got problems with animation sync. It calls NullReferenceException and animations dont sync by the net. Error comes in this string :"activeWeapon.name = weapManager.SelectedWeapon.weaponName;".
    Also, when second player connected to the room, perfomance drop down. "Phisics.Simulate" kill perfomance of powerful CPU, but no rigidbodies on scene.
    We hope very much for your help.
     
  9. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Actually I just tested a Demo preview and inside Editor by opening 2 windows near each other. Everything seems to work as expected, I can see walking animation, crouch and prone (which is always idle because example character do not have certain animations).


    In latest version of FPS Kit 2.0 (v1.4) AnimatyonSync.cs and PlayerLocationSync.cs were combined into one script PlayerNetworkController.cs (which is attached to root object).
    From your error I suppose you using older version, so I suggest download latest one from Asset Store (for free using same account you purchased with).

    The performance is dropped because of errors, FPS Kit 2.0 is well optimized and give good frames per second even with many players
     
  10. ZeoWorks

    ZeoWorks

    Joined:
    Dec 13, 2012
    Posts:
    76
    No no you seem to be misunderstanding what I say. For particular people on particular computers (I'm not sure which ones but there are a few), this problem happens to they're character and only they're character, no one elses; and everyone can see it.
     
  11. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    Hello I'm trying to add the self damage to my player. I'll try myself to edit the code, but any help would be apprecited. Thanks
     
  12. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hi,

    Try to replace Projectile prefab in third person weapon copy from Remote (Prefabs/RemoteProjectiles) to Normal one (Prefabs/Projectiles).

    Since explosive weapons was not programmed to do any damage to our player, this way will contain some bugs:

    - You will not able to damage your player while there is no other players in room
    - Kill notification will display wrong names when you kill your player
     
  13. maffffffffew

    maffffffffew

    Joined:
    May 17, 2013
    Posts:
    5
    NSDesignGames, Zeoworks is right.

    The default character is fine and jolly with no problems.
    While when you put your own character + animations, any character, it messes up.

    I've tried so much characters, etc and the animation sync still messed up.

    The animations just dont play, no console errors, plays if you enable thirdperson character for the player in unity that works but its not syncing other players animations.

    On one occasion onlyh the crouch and moving animations worked whilst the others didnt. And yesterday only prone animation worked no other ones and i was stuck on the prone animation.

    This has something to do with the animation sync as Zeoworks suggested, please look into it because theirs nothing we can do without that fixed...
     
  14. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Make sure you assigned all comunication game objects (AnimationSyncHelper, AnimationForHands and ActiveWeapon) into CharacterAnimation.js assigned to root of your animated soldier;

    Also make sure all animation variables in CharacterAnimation.js are assigned into lists aswell: "Animations", "Two Handed Weapons", "Pistols", "Knives";
    (All animation should be also included in animations list in Animation component)

    Next thing, you need to check HeadLookController.cs is attached to your soldier root (near CharacterAnimation.js) and assign all variables there. Than drag and drop this component to variable "Head Look Controller" in PlayerNetworkController.cs (attached to root of NetworkPlayer)

    Save your character back into prefab.


    Sorry but It's hard to believe there was no errors while something didn't worked.
    Make sure you do next:

    - Make sure console do not have Error hide option enabled
    - Make new build after you done all setup and run it (create new room there)
    - Open editor and connect to that room and check if other character animation works, if not, you definetly should see some errors in console.

    Recheck tutorial called "Setup 3rd Person Character for Multiplayer" (link on front post)

    All explanation applying for FPS Kit 2.0 (v1.4 - which is most recent). If you use older version, I suggest you download latest one for free using account you purchased it with.
     
  15. ZeoWorks

    ZeoWorks

    Joined:
    Dec 13, 2012
    Posts:
    76
    That's understandable but even your web player demo(s) has this problem and I can guarantee you that anyone else using this kit will eventually have this problem while playing online with someone else also, its not our modifications that's the problem, its the kit itself. >.<
     
    Last edited: May 17, 2013
  16. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    You might want to test multiplayer demo before affirm something.

    Open Multiplayer Demo in 2 windows: http://warmerise.com/FPSKit/2.0.html
    Join same room and see if animation is synced or not

    The bug ZeoWorks described probably happend for some players due to internet connection problem and animation clip wasn't synced during some time. This type of bug have nothing to do with actual script and relatively rare.

    Also Instead of telling if my suggestions helped you went straight saying that problem is in Kit. Sure it's easier to blame someone's work instead of understanding how it works.

    Just so you know, I would never submit something to Asset Store knowing it doesn't work or there some bugs.

    Hope you understand

    P.S. Next time if you want me to help please give better explanation of problem (Like what changes you did before, have you followed any of tutorials listed on front post, are you using latest version of Kit etc.)
     
  17. ZeoWorks

    ZeoWorks

    Joined:
    Dec 13, 2012
    Posts:
    76
    I have, you're not understanding me correctly.

    In my case it isn't rare, a few of my players have had this bug and everyone could see them without animation .etc
    I'm not trying to say you are posting this to the asset store knowing it has bugs, I have tried out all the suggestions you have submitted but no result.
    Like I said even the web player demo shows this bug on particular players. I personally do have animation working correctly for me (and everyone else can see it), but other particular players (not all of them) have this bug and I don't believe its due to they're internet connection. Sorry I'm not the best at explaining things.
     
  18. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    There could be other problem, when users download FPS Kit 2.0 to their Unity editor it have Photon Cloud ID which comes with Preview demo.
    And some users probably haven't changed to their own Photon Cloud ID. I know it because I received e-mails asking how to change cloud ID because they were connecting to public Demo.

    So they basically can connect to everyone playing on Preview Demo.

    And I suppose some users did a changes on their end which caused that animation states are not sent over network and that's why other players on demo cant see any animation playing.

    I hope you changed Photon Cloud ID to your own, if not, go to http://cloud.exitgames.com/, register there (if you haven't) than copy/paste your ID into Unity (Window -> Photon Unity Networking) than Save. Now you have your own server and players can only connect to it from your game.
     
  19. ZeoWorks

    ZeoWorks

    Joined:
    Dec 13, 2012
    Posts:
    76
    Thank you for your reply, but the thing is though that this has happened in every version no matter if I/they change the Cloud ID or not (Since older versions does not have a default id). :)
     
  20. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    NSdesignGames how i can when i shot to the head player directly die?
    and tell on Windows Headshot?
     
  21. Noah-Essa24

    Noah-Essa24

    Joined:
    Apr 17, 2013
    Posts:
    9
    I really want a Co-op mode in my game and it would be really nice if i could add my own game modes. :)

    Oh yeah. Can you also tell me some of the major updates in the next update and possible estimate a release date. -Noah
     
  22. Luca91

    Luca91

    Joined:
    Apr 13, 2013
    Posts:
    75
    Thanks that worked, Is there any way to fix just the Kill notification bug ? Thank you for your support.
     
  23. WhendricSo

    WhendricSo

    Joined:
    Jan 1, 2011
    Posts:
    171
    Let's get some melee attacks implemented for version 2.5!
     
  24. maffffffffew

    maffffffffew

    Joined:
    May 17, 2013
    Posts:
    5
    Hello,

    How do i setup the head controller?

    When i try run mine, the character goes weird

     

    Attached Files:

  25. Ds777

    Ds777

    Joined:
    Apr 30, 2013
    Posts:
    15
    How change player weapons in spawn? I do not want all weapons when player spawn, I tried a solution for hours, I can not

    You wrote

    I get error, any other solution?

    View attachment 54207
     
  26. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hi,

    Have you assigned Look Target into variable?
    Also which Bones you assigned?

    Segments must have 1 element, the First Transform is
    a Waist bone and the second bone is child of it.

    Non Affected joints have 2 elements those are left/right shoulder bones.

    If you assigned everything right, see what values example character have and copy them.

    Even if you did everything right, your soldier bones may have different rotation, if so, you will have to tweak values to match your character.

    Cheers!

    Hi,

    Make sure Weapon List do not have empty elements (So if you assigned 2 weapons, list Lenght should be 2 aswel)

    Cheers!
     
  27. Josifjoey

    Josifjoey

    Joined:
    May 12, 2013
    Posts:
    14
    Has Anyone Found a way to make a register system with php ?
    and would you be so kind to Share how it was done :)
    Thanks.
     
  28. Master_Chief

    Master_Chief

    Joined:
    Feb 11, 2013
    Posts:
    22
    Hey everyone, can anyone put up a tutorial on how to add your own guns? I tried to simple duplicate then replace with my own models and animations but it failed.. any help would be appreciated..
     
  29. maffffffffew

    maffffffffew

    Joined:
    May 17, 2013
    Posts:
    5
    Its happening still..
    i've done exactly what youve said even with other bones and i get that :(

    Any ideas?
     
  30. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Check front post, under Tutorials open one called "How to setup new weapon?"

    Probably armature bones on your character have different z rotation, so you will have manually tweak values on Head Look Controller
     
  31. Kazoos

    Kazoos

    Joined:
    Nov 28, 2012
    Posts:
    19
    NSdesign How can I set so a game object such as a sphere can receive damage from bullets and missles etc? Any simple way of doing this?
     
  32. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hi,

    Here is simple script that will receive damage from Bullet.js

    Create empty JavaScript and paste this, than attach it to your sphere.

    This is just a basic example which will destroy your sphere when hp reach 0;

    Code (csharp):
    1. var hp : int = 100;
    2.  
    3. function ApplyDamage(damage : float){
    4. hp -= damage;
    5. if(hp < 0){
    6. Destroy(gameObject);
    7. }
    8. }
     
  33. Kazoos

    Kazoos

    Joined:
    Nov 28, 2012
    Posts:
    19
    Thank you so much, you are amazing.

    I still struggle to get to gribs with Unity and JS. I use JS ever day but struggle too see how it all interlinks in Unity.

    Do you have any idea why I do not get bullet holes - On my new levels.
     
    Last edited: May 25, 2013
  34. Noah-Essa24

    Noah-Essa24

    Joined:
    Apr 17, 2013
    Posts:
    9
    Hello,

    Could you please add... Better graphics, Class system (that would be amazing), better animations (when i go prone it just makes a guy look like a turtle and slowly move around. Co-op (That would make it worth 100$), more weapons, and more game modes. Better spawn system (i some times spawn in the same spawn point as a team mate or enemy so im stuck there) i also spawn in front of people alot. And finally... Vehicles. I really want a jet, helicopter, boat, car.


    It's alot of stuff you have to put in, but it's kinda a rip off right now. I know it's the best kit, but it's not worth 70 dollars. Make the kit 2.00$ or add all of the stuff above and sell it for 90$.

    -Noah
     
  35. Noah-Essa24

    Noah-Essa24

    Joined:
    Apr 17, 2013
    Posts:
    9
    please make it so different teams have different player controllers. Make it so if you're on team A, you're character looks like a U.S personnel. And if you're team B, make the character controller look like Taliban. Also add the random team button so not all people join U.S and 1 person joins Al qaeda..

    -Noah
     
  36. Josifjoey

    Josifjoey

    Joined:
    May 12, 2013
    Posts:
    14
    Hello, I disagree i got this kit about a 4-5 days ago and it was so worth 70 Dollars if not it should be more! as for your requests It has already two game modes witch allow's you to use it as a template you will be able to make any kind of game mode same with the guns there's plenty there as an example and adding your own is really easy with the graphics i don't think this is a map pack or anything its mainly there for show like ill'd honestly rather the map begone it really just means i need to do more cleaning up later, With the spawning i agree and the Vehicles that will be really handy. if you haven't brought this kit already it really is worth 70$ as i said before.

    -- Josif
     
  37. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496

    Check front post, under tutorials see the one called: "Setup impact holes for different surfaces"
     
  38. Kazoos

    Kazoos

    Joined:
    Nov 28, 2012
    Posts:
    19
    I disagree 100%. You are wrong. This is worth more than $70.. Too the right person this could be worth $1000 dollars. If you are too incredibly stupid to understand the hours of work gone into this then you should maybe look at some other career. I am charged out at a day rate of £450, that is about $600. This I would suggest has taken at least 20 days of development.. Do the math.

    NSDesign has done a great job of this and it a great foot-stone for development.
     
  39. Kazoos

    Kazoos

    Joined:
    Nov 28, 2012
    Posts:
    19
    Oh right. They are on layers. Simples! :) Cheers NS
     
  40. midorina

    midorina

    Joined:
    Jun 1, 2012
    Posts:
    131
    Trying to edit the WhoKilledWho.cs script so that it will display the names in current team colours. I have a Blue Team and a Red Team. If a member from the Blue Team kills someone in the Red Team, I want to show the Blue Team name in blue at the top right hand corner (even when you are on the Red Team).

    I tried:
    Code (csharp):
    1.                 if(PhotonNetwork.player.customProperties["TeamName"] == rmm.team_1.teamName){
    2.                 GUI.color = Color.red;
    3.             }
    4.                
    5.                         if(PhotonNetwork.player.customProperties["TeamName"] == rmm.team_2.teamName){
    6.                 GUI.color = Color.cyan;
    7.             }
    However this displays the KILLER in your (the player) own team's colour. So if you are on Red, the Killer will be in Red (if he was on Blue Team).

    How can I make it so that it displays the Killer has its own colour based on what team he is with? Something like if wkw.killer == rmm,team_2.teamName

    Cheers!
     
  41. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    You will have to store color for each case in variable

    For example killer and killed player names are stored here:

    Code (csharp):
    1.     public struct WhoKillWho {
    2.         //Name of the player who killed other player
    3.         public string killer { get; set; }
    4.         //Name of the player who got killed
    5.         public string killed { get; set; }
    6.        
    7.         public WhoKillWho(string string1, string string2){
    8.             killer = string1;
    9.             killed = string2;
    10.         }
    11.  
    12.     }
    13.     public List<WhoKillWho> whoKillWho = new List<WhoKillWho>();
    So what you need to do is add 2 more variables for Killer Color and Killed color

    Code (csharp):
    1.     public struct WhoKillWho {
    2.         //Name of the player who killed other player
    3.         public string killer { get; set; }
    4.         //Name of the player who got killed
    5.         public string killed { get; set; }
    6.             public Color killerColor { get; set; }
    7.             public Color killedColor { get; set; }
    8.        
    9.         public WhoKillWho(string string1, string string2, Color killerC1, Color killedC2){
    10.             killer = string1;
    11.             killed = string2;
    12.                 killerColor = killerC1;
    13.                 killedColor = killedC2;
    14.         }
    15.  
    16.     }
    17.     public List<WhoKillWho> whoKillWho = new List<WhoKillWho>();
    NOTE: You will have to edit the place where variables are set:

    Code (csharp):
    1. whoKillWho.Add(new WhoKillWho(killer, killed, killerColor, killedColor));
    Now that you have all required variables, use them in OnGUI to define a color of each name
     
  42. TheBorDr

    TheBorDr

    Joined:
    Oct 14, 2012
    Posts:
    15
    This kit is amazing. Amazing. No other FPS kit compares in features and art content....

    My only question is what the next update will include? The last one had me frantically updating unity to play with teams and gametypes. Put in simple AI and you could create an entire game with this kit. (Not that you couldn't already.)
     
  43. SLIMEBASS

    SLIMEBASS

    Joined:
    Aug 26, 2012
    Posts:
    9
    I know this is kind of much to ask for but how can i make so that after 10 minutes the server/room closes?

    BTW Best Buy on the asset store :)
     
  44. Josifjoey

    Josifjoey

    Joined:
    May 12, 2013
    Posts:
    14
    Hello
    I need some help with when the player falls out of the map to make player die.
    how would i be able to do this with trigger?
    so that Quick Example --- OnTriggerEnter("GuardianKiller") - CurrectHp = 0; --- ( But This only displays 0 and not actually kills player )
    I've tryed so many ways but since I'm only training i don't know what else to try ?
    This will also help to know since i could use this for many other things

    Thanks--Josif
     
  45. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    Hi,

    To make player leave room when round ends:

    - Open RoomMultiplayerMenu.cs and scroll to line 232 where it says

    Code (csharp):
    1. StartCoroutine(Restart());
    Replace it with:

    Code (csharp):
    1. LeaveRoom();
    You can tweak round duration at Main Menu scene.

    Hi,

    To kill player without damaging it do next:

    - Open PlayerDamage.cs and add next function at line 150

    Code (csharp):
    1.    
    2.     void DestroyOurPlayer(){
    3.         if(photonView.isMine){
    4.             photonView.RPC("RPCDestroyOurPlayer", PhotonTargets.All);
    5.         }
    6.     }
    7.     [RPC]
    8.     void RPCDestroyOurPlayer(){
    9.         //Spawn ragdoll
    10.         GameObject temp;
    11.         temp = Instantiate(ragdoll, transform.position, transform.rotation) as GameObject;
    12.         if(photonView.isMine){
    13.             temp.SendMessage("RespawnAfter");
    14.             StartCoroutine(DestroyPlayer(0.2f));
    15.         }else{
    16.             temp.SendMessage("clearCamera");
    17.         }
    18.     }
    19.     }
    - Then create other script that will be attached to trigger area and will call this function (Example Javascript)

    Code (csharp):
    1.     function OnTriggerEnter (other : Collider) {
    2.         other.gameObject.SendMessage("DestroyOurPlayer", SendMessageOptions.DontRequireReceiver);
    3.     }
     
    Last edited: May 27, 2013
  46. Josifjoey

    Josifjoey

    Joined:
    May 12, 2013
    Posts:
    14
    Thanks NSdesignGames
    That's a relief to be done :)

    if anyone wants the script i use for the triggered Object, converted into c# i didn't need to add much but
    Simply Make a new c# script call it anything and add this..(you will also need to add them lines NSdesignGames helped me with)

    void OnTriggerEnter(Collider other) {
    if(other.gameObject.tag == "Player")
    {
    other.gameObject.SendMessage("DestroyOurPlayer", SendMessageOptions.DontRequireReceiver);
    }
    }

    Edit: I made it that when you get killed by trigger player gains a death
    replace DestroyOurPlayer in the PlayerDamage.cs With This at line 150:

    void DestroyOurPlayer(){
    //Add Death to player score
    int totalDeaths = (int)PhotonNetwork.player.customProperties["Deaths"];
    totalDeaths ++;
    Hashtable setPlayerDeaths = new Hashtable() {{"Deaths", totalDeaths}};
    PhotonNetwork.player.SetCustomProperties(setPlayerDeaths);
    if(photonView.isMine){
    photonView.RPC("RPCDestroyOurPlayer", PhotonTargets.All);
    }
    }
     
    Last edited: May 27, 2013
  47. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    Hy NSdesignGames can you please tell me how i can when i shot it on head on windows show Headshot on the screen when i kill it like into your game thanks!
     
  48. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    496
    You need to check the last Hit Box that PlayerDamage.cs received damage from (Right before reaching 0 hp).
    So if that Hit Box belong to head, you notify WHoKilledWho.cs that certain kill was with headshot, than simply display it on screen
     
  49. Josifjoey

    Josifjoey

    Joined:
    May 12, 2013
    Posts:
    14
    can we get an example for us noobs ? :S
     
  50. SLIMEBASS

    SLIMEBASS

    Joined:
    Aug 26, 2012
    Posts:
    9
    Thanks dude!

    Got 1 more question for you. I cant pickup instantiated weapons?
    I Get this error:
    Code (csharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object
    3. WeaponPickUp.Update () (at Assets/FPS Kit Version 2.0/_CustomAssets/Scripts/WeaponSystem/WeaponPickUp.js:117)
    4.  
    Here is the code:
    Code (csharp):
    1.  
    2. var prefab : GameObject;
    3.  
    4. function Start () {
    5.     var clone = Instantiate (prefab, transform.position, transform.rotation);
    6. }
    7.  
    Cheers