Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

FPS Kit | Version 2.0

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

  1. Essekey

    Essekey

    Joined:
    Nov 6, 2013
    Posts:
    15
    How to make steps were heard other players, not just their own?
     
  2. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Corrected script:
    Code (csharp):
    1.     void SpawnPlayer(string teamName){
    2.         if(Player){
    3.             PhotonNetwork.Destroy(Player);
    4.         }
    5.         enableHelper.SetActive(true);
    6.         Hashtable setPlayerTeam = new Hashtable() {{"TeamName", teamName}};
    7.         PhotonNetwork.player.SetCustomProperties(setPlayerTeam);
    8.         //Spawn our player
    9.         int temp;
    10.         if(teamName == team_1.teamName){
    11.             if(gameMode == "TDM"){
    12.                 temp = Random.Range(0, team_1.spawnPoints.Count);
    13.                 Player = PhotonNetwork.Instantiate(playerPrefab.name, team_1.spawnPoints[temp].position, team_1.spawnPoints[temp].rotation, 0);
    14.                 Player.name = PhotonNetwork.player.name;
    15.             }else{
    16.                 //Spawn player in DM mode
    17.                 temp = Random.Range(0, allSpawnPoints.Count);
    18.                 Player = PhotonNetwork.Instantiate(playerPrefab.name, allSpawnPoints[temp].position, allSpawnPoints[temp].rotation, 0);
    19.                 Player.name = PhotonNetwork.player.name;
    20.             }
    21.         }else{
    22.             temp = Random.Range(0, team_2.spawnPoints.Count);
    23.             Player = PhotonNetwork.Instantiate(playerPrefab2.name, team_2.spawnPoints[temp].position, team_2.spawnPoints[temp].rotation, 0);
    24.             Player.name = PhotonNetwork.player.name;
    25.         }
    26.         roomCamera.SetActive(false);
    27.     }
     
  3. Mihai93

    Mihai93

    Joined:
    Jul 14, 2012
    Posts:
    213
    We can know what you think to add into next update?
     
  4. eliteslayer

    eliteslayer

    Joined:
    May 12, 2013
    Posts:
    64
    Thank you so much Stan I really appreciate it.
     
  5. Essekey

    Essekey

    Joined:
    Nov 6, 2013
    Posts:
    15
    Please tell me how to do it.
     
  6. Optical-Illusions

    Optical-Illusions

    Joined:
    Dec 23, 2013
    Posts:
    32
    Hi,
    just wondering if in the next update there could be some killstreaks because that would be very cool. Anyway I ask that because I have been trying to add killstreaks myself into my game but so far it has only caused glitches and errors in the game with the network player so just something to take in mind for the next update.
    Thanks/
     
  7. Idialot

    Idialot

    Joined:
    Dec 8, 2013
    Posts:
    14
    Guys, as a possible purchaser of this framework, the responses I read are quite disconcerting. Yes agreed that one needs to read and study, learn from what has been created. But for most, human nature kicks in and we want to dig in and see something blasting on the screen. The "When all else fails... read the manual" attitude prevails. Many learn through hands on and experimentation while others (lucky them) can absorb information with reading. Also realized, you do need to do a search first to ensure the "Question has not been addressed" so as to avoid repetitive Q.A. sessions.

    I have been in IT for over two decades. Mostly Sys Admin, L.A.M.P. based systems mostly Php MySQL programming with a bit of Perl and Python. But those days are gone... Retired. Presently trying to learn C++ online... and found it very helpful. I understand what the code is doing when I read it but still not quite understanding the syntax and such but this will come in time. What I and quite sure this would help others as well is a Flow Chart. How do the games run? how do the components interact and what files are being used in each interaction. Yes there is lots of reading and textual help. A Flow Chart is Visual and is of utmost importance to visual learners like myself. So if you guys want to build an awesome manual, write it to follow the chart.


    Cheers to all, patience prevails...

    Newbie...
     
  8. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    You'll need to update script "PlayerNetworkController.cs". Most changes are just copied from "FPSSoundController.cs" script
    1. Add to the declaration section
    Code (csharp):
    1.  
    2.     public AudioClip[] walkSounds;
    3.     public float walkStepLength = 0.45f;
    4.     public float runStepLenght = 0.38f;
    5.     public float crouchStepLenght = 0.38f;
    6.    
    7.     //CharacterController controller;
    8.     float lastStep= -10.0f;
    9.     float StepLenght;
    10.  
    2. Add to Update() right after "if (!photonView.isMine){"
    Code (csharp):
    1.  
    2.             if(!currentAnimation.Contains("Idle"))
    3.             {
    4.                 if(animType == "Walking"){
    5.                     PlayStepSounds();
    6.                     StepLenght = walkStepLength;
    7.                 }
    8.                 if(animType == "Running"){
    9.                     PlayStepSounds();
    10.                     StepLenght = runStepLenght;
    11.                 }
    12.                 if(animType == "Crouch"){
    13.                     PlayStepSounds();
    14.                     StepLenght = crouchStepLenght;
    15.                 }
    16.             }
    17.  
    3. Add new function "PlayStepSounds()"
    Code (csharp):
    1.  
    2.     void PlayStepSounds(){
    3.         if(StepLenght == 0)
    4.             return;
    5.         if (Time.time > StepLenght + lastStep){
    6.             audio.clip = walkSounds[Random.Range(0, walkSounds.Length)];
    7.             audio.Play();
    8.             lastStep = Time.time;
    9.         }
    10.     }
    11.  
    4. Assign variables
    $pnc.jpg
     
  9. Essekey

    Essekey

    Joined:
    Nov 6, 2013
    Posts:
    15
    Thank you!
     
  10. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    So any idea why I always get (clones) ? If I want team B with different skin should I drag NetworkPlayer in the scene then duplicate or do it right away from the prefab then drag duplicated into scene to change it ? or is the problem with network ID not being set since I get the same player name in my 2nd game instance to test it out ... ?Always end up with clones not updating movements or anything ....
     
  11. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    I just tested the clean 2-nd character add and it worked fine for me. Most probably you've just screwed up your project. Try to create the new project, import the kit and apply your changes.
     
  12. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    I started clean also ... I simply import FPS Kit 2.0 / put main menu and bunker in build settings then I click on NetworkPlayer and ctrl-d to duplicate it and get NetworkPlayer1 put it in the scene create 2 new mats (ex:Red) put it on NetworkPlayer1 save it to prefab then delete it from scene.
    Open RoomMultiplayer(script) change it to the corrected post you did... save it , add NetworkPlayer in PlayerPrefab and add NetworkPlayer1 in PlayerPrefab2 then make a build .. open 2 instances with 1 in each team , and I see enemy with NetworkPlayer(clone) over its head in a T position not updating anything on other game instance.... what am I doing wrong ?

    I did get it to work once but right when I exit and come back .. clones again ...
    Also why am I getting same player name in my 2nd game instance (even if I erase Playerprefs folder) ?
    I remember always getting a random Player (#) in older versions !
     
    Last edited: Feb 8, 2014
  13. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    Yea ..it says that now it saves PlayerName is that the problem are you using an older version ?

    Well I removed adding PlayerName in Playerprefs from connect menu and got back with Player ( random # ) but still got clones .... this is a pain.
     
    Last edited: Feb 8, 2014
  14. NewIceDE2

    NewIceDE2

    Joined:
    Jan 18, 2014
    Posts:
    5
    Can i use the asset for a commercial project?
    Thanks:)
     
  15. Essekey

    Essekey

    Joined:
    Nov 6, 2013
    Posts:
    15
    Yes
     
  16. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    It works for me too but as soon as I close unity and come back make a build again I always end up with (clones) again at some point ...

    So its just me that has the problem ? no one else has that problem with the kit ?
     
  17. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Ok I was able to reproduce it after re-open project. Fix is very simple - just add tag ""Remote"" to the project
     
  18. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    THANK GOD !!! I was going crazy thinking i was alone forgetting or doing something wrong...

    But hey ! it did fix the clones problem... heh thanks Stan i remember having to add tag ''remote'' from ways back... would've never thought of that ! , Only problem now thought characters go thru the floor like if at some point update just gives up and forget collisions.
    + i get funky stuff happening with ragdoll now exorcist type of stuff going on ... pretty crazy lol ..

    I redid a clean start and it works ! no longer getting (clones) problem even if unity keeps telling me that gameobject tag Remote is already registered ... I previously tested on basically the same expect I added my own models then I was getting the going thru floor after some time problem only after I added the tag remote...

    Gonna keep at it see what fixes that problem when integrating my own models Thanks Again !
     
    Last edited: Feb 10, 2014
  19. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    Yea.. now every time I try to use my own models, characters just fall thru ground after a few secs can't put the finger on what is causing this ...
     
  20. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    Dear NSdesign games why can't I have 2 different models ? :mad:
     
  21. p93dweb-ch531

    p93dweb-ch531

    Joined:
    Jun 28, 2013
    Posts:
    4
    @NSdeginGames Hi. I got a lot of news features with FPS Kit 2.0 :
    - AH6 (helicopter) from MW3 is fully controllable from fps to ah6 and back (actually fixing some bugs)
    - switching with FA-18 too, attack boat like BF4 too.
    - customized camo from nsdesign stored in user DB
    - others features; dblogin and facebook webplayer opti,
    - fractured object are sensitives to big missiles (network sync too) and everybody (chopper and so one are easy killing in a lobby)
    This features will appear in my next game called "Cherry Island" made at 90% by me and my team for the 3d objects and at 30% code fully made by me. If someone is interessed to see the first trailer http://www.youtube.com/watch?v=qIb7OmVxzVg
    @NSdesignGames : hope to give you feedback soon and if can I give example of extended features on this topic?
     
  22. allpay

    allpay

    Joined:
    Mar 28, 2012
    Posts:
    31
    @NSdeginGames
    I have a strange problem that I never read in this forum before :(
    In sample scenes (bunker Jumper) there is no problem. But in my scene, my character starts to vibrating.
    In my scene I am using a huge terrain, so this may be a possible reason.
    What should I do? pls hlp :sad:
     
  23. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    494
    Hey,

    To fix this problem select each Hit Box collider you have assigned to your model and add Rigidbody component, also mark it as Kinematic
     
  24. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    494
    Hey,

    Just checked a Trailer, looks very cool. Looking forward for future updates.
    Will it be multiplayer FPS?

    Cheers!
     
  25. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Can you post video with the gameplay?
     
  26. p93dweb-ch531

    p93dweb-ch531

    Joined:
    Jun 28, 2013
    Posts:
    4
    The gameplay video is the part II of trailers for sure! and I will post some captured sequences for this topic
     
  27. p93dweb-ch531

    p93dweb-ch531

    Joined:
    Jun 28, 2013
    Posts:
    4
    Yes it will in small sized area 40mo cached downloaded and loaded in webplayer. I need to put the mixamo characters on your hit box script. The scripting of helicopter is taken for the unity community but under 30.0 fps there is some hard network lag too. The fact of spawning a rigidbody for unpiloted chopper (like flying) is difficult to integrate on the photon network but the actual heligun is the rpg from your character. Facebook integration will be in public access this year. Stay tuned
     
  28. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    Awesome thanks NSdesignGames ! :D
     
  29. davidal_VK

    davidal_VK

    Joined:
    Jul 24, 2013
    Posts:
    5
    hello. sorry for my English, I use google translator:

    I would make a game of killing zombies, but do not know how to do the zombie script.
    I'd like a script that would make the zombies appear on the spawn, and at most 50 zombies at once.
    The zombies are after players (Animated "run") and when they are with you they attack (animation "attack") but die when shot.
    I hope you understand, Thanks
     
  30. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Sooner or later you're going to have to learn how to program.
    Asking others to program bits of your game for you isn't a good way to make a game - because you're not making a game then. Someone else made the game and you released it.
    If you don't have the knowledge to make something like this, my advice is to start simpler. Make smaller games, pong clones, simple flash-style games, things of that nature. If there's something you don't know how to do, don't just ask others to do it for you. Figure out exactly what it is you don't know how to do - is it that you don't know how to spawn zombies? How to make them chase the player? Etc? Find out which bits you don't know and start Googling.
    And remember that you can always ask others for help (I do it all the time), as long as you're not asking them to write a script for you.
     
  31. Essekey

    Essekey

    Joined:
    Nov 6, 2013
    Posts:
    15
    how to make alternate play idle animations? I just have a few idle animations and I want to have them voisprovodilis until the player is active.
     
  32. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    Mmm how does Head Look Controller work ? I mean its like a battle of trial and error for me ...

    Even Example character if targeting another player isn't even looking at him actually looking left :confused: and if you look down head look goes crazy...

    Any new model try .. Head Controller goes crazy..

    I mean I understand wich transform to use for segment and the values for it ...

    Non Affected joints that's good ...

    But Head Look Vector ???
    Head Up Vector ???
    Is it a value for segments does it affect Look Target why would I give a higher value to "effect"

    at 1st I thought it was for segments then I looked up example character's transform directions and Head look vector / Head Up Vector values so if I had same for the new models But even if I do the same its all goes crazy ...

    Can someone Explain Head Look Controller or even understands it ?:rolleyes:
     
  33. domwhu777

    domwhu777

    Joined:
    Jan 2, 2013
    Posts:
    4
    Make a AI / bot kit and also a vehicle kit as an extension of this and you will make a fortune.
     
  34. allpay

    allpay

    Joined:
    Mar 28, 2012
    Posts:
    31
    Anybody has any idea about this problem???
     
  35. NewIceDE2

    NewIceDE2

    Joined:
    Jan 18, 2014
    Posts:
    5
    Hello,

    i need some help. When i want to test the fps kit and i create a room and join i can´t chose a team, because the buttons are disabled? Why? Can someone help me?

    $Unbenannt.PNG
     
  36. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    How to replace 3rd person character tutorial is nice and all but I have tried over 4 models and the problem seems to be with Head Look Controller nothing is really mentioned about it in it , that thing comes from hell ...

    I see people using 3drt marines model how did you ever get it to work with HeadLookController No matter what I do character is never straight and no matter what I try it doesn't work I think that thing need an overhaul baaaaaaaaaaaaaaaad ...:sad: or is it just me .. ?

    Stan.B I see your are using marines did you manage to make em work in fps kit 2.0 or you used something entirely different ??
     
  37. davidal_VK

    davidal_VK

    Joined:
    Jul 24, 2013
    Posts:
    5
    Hello. I created a mini map in my game, but when several people are connected at the same time a failure occurs, Everybody sees the minimap the player who created the game. (it is a camera that I put on one side of the screen.
    that you may see the fail I put a link to my game open in two windows so you can see the error: https://googledrive.com/host/0B6MZPdPVfK2JN29JSTBxQVBaWEU/prueba web player.html
    *
    How I can do that does not happen?

    I USE THE GOOGLE TRADUCTOR, SORRY FOR MY ENGLISH
     
  38. NewIceDE2

    NewIceDE2

    Joined:
    Jan 18, 2014
    Posts:
    5
    How do i do that at the beginning the networkplayer has no weapon...?
    Thanks:)
     
  39. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Not the best solution but it works for me(script HeadLookController.cs):
    - Add to the declaration section after "public bool overrideAnimation = false;"
    Code (csharp):
    1. public Quaternion Correction;
    - Add the following line after "t.rotation = dividedRotation * t.rotation;"
    Code (csharp):
    1. t.rotation = t.rotation * Correction;
    - Assign value to the new variable
    $hlc.jpg
     
  40. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    Well I don't get it aligned with 1st person with theses values but its a little easier to calibrate now thanks Stan !

    Now my new problem that seems to have come with new kit update :mad: is when I setup a new weapon in 3rd person when I put in weapon sync I get ''First Person Weapon'' slot to open so I put it in then I get muzzle flash to open after but I don't get projectile nor Fire Audio to open up ... what is up with that now ?
     
  41. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    494
    To make setup easier it gets Bullet prefab and Audio Clip from first person weapon automatically
     
  42. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    ah well it does not work I see it in 1st person but nothing happens in 3rd person now :(

    Works fine with older version.... and now we can't have projectiles not remote so we have friendly fire ?

    I got it to work with the same bullet prefab but somehow as soon as I make my own bullet prefabs with particle effects it does not show will try more things...
     
    Last edited: Feb 17, 2014
  43. drakekaz

    drakekaz

    Joined:
    Jan 16, 2014
    Posts:
    42
    Does anyone have a solution to this problem? Some how I have lost syncing between characters.

    UnityException: Tag: Remote is not defined!
    PlayerNetworkController.Awake () (at Assets/FPS Kit 2.0 C#/_CustomAssets/Scripts/Network/PlayerNetworkController.cs:82)
    UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
    NetworkingPeer:DoInstantiate(Hashtable, PhotonPlayer, GameObject) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2051)
    NetworkingPeer:OnEvent(EventData) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1521)
    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:76)
     
  44. Essekey

    Essekey

    Joined:
    Nov 6, 2013
    Posts:
    15
    Add the tag "Remote" in your project ;)
     
  45. PixelPaw

    PixelPaw

    Joined:
    Feb 18, 2013
    Posts:
    91
    Trying to set aim position... it is perfectly aligned with the iron sight but iron sight isn't perfectly aligned with shots , aim position values place weapon and hands with a rotation but how I can simply move it up down left and right ?
    I can do that with the hands + weapon prefab for when I'm not aiming down sight but how would I do that for aim mode ?
     
  46. Essekey

    Essekey

    Joined:
    Nov 6, 2013
    Posts:
    15
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4.  
    5.  
    6. [RequireComponent (typeof(AudioSource))]
    7.  
    8. public class FPSSoundController : MonoBehaviour {
    9.  
    10.     public AudioClip[] concrete;
    11.     public AudioClip[] wood;
    12.     public AudioClip[] dirt;
    13.     public AudioClip[] metal;
    14.     public float walkStepLength = 0.45f;
    15.     public float runStepLenght = 0.38f;
    16.     public float crouchStepLenght = 0.38f;
    17.    
    18.     //CharacterController controller;
    19.     FPScontroller motor;
    20.     float lastStep= -10.0f;
    21.     float StepLenght;
    22.     string surface;
    23.    
    24.     void Awake(){
    25.         StepLenght = walkStepLength;
    26.         //controller = GetComponent<CharacterController>();
    27.         motor = GetComponent<FPScontroller>();
    28.     }
    29.  
    30.     void OnCollisionEnter (Collision col)
    31.     {
    32.         surface = col.gameObject.tag;
    33.         Debug.Log("Tag");
    34.     }
    35.  
    36.     void FixedUpdate(){
    37.         //Check when player walk or run to play footstep sounds with different speed
    38.         if(motor.prone)
    39.             return;
    40.         if(motor.Walking  motor.grounded  !motor.crouch){
    41.             PlayStepSounds();
    42.             StepLenght = walkStepLength;
    43.         }
    44.         if(motor.Running  motor.grounded){
    45.             PlayStepSounds();
    46.             StepLenght = runStepLenght;
    47.         }
    48.         if(motor.Walking  motor.crouch  motor.grounded){
    49.             PlayStepSounds();
    50.             StepLenght = crouchStepLenght;
    51.         }
    52.     }
    53.  
    54.     void PlayStepSounds(){
    55.         if(StepLenght == 0)
    56.             return;
    57.         if (Time.time > StepLenght + lastStep){
    58.             if (surface == "Dirt") {
    59.                 audio.clip = dirt[Random.Range(0, dirt.Length)];
    60.                 audio.Play();
    61.             }
    62.             if (surface == "Wood") {
    63.                 audio.clip = wood[Random.Range(0, wood.Length)];
    64.                 audio.Play();
    65.             }
    66.             if (surface == "Concrete") {
    67.                 audio.clip = concrete[Random.Range(0, concrete.Length)];
    68.                 audio.Play();
    69.             }
    70.             lastStep = Time.time;
    71.         }
    72.     }
    73. }
    Does not work, tell me what's the problem? Even debug does not work ...
     
  47. BL Studios

    BL Studios

    Joined:
    Feb 18, 2014
    Posts:
    11
    hello, good.

    I want a little help with this, buy FPSKit, everything is very good, but there is something that bothers me a little ... is that when you start the server, the player has all the weapons at your disposal ...

    then, as modified the "WeaponManager" script in the menu to pause or 4-5 menuLobby can choose weapons, which are with the player appear ...

    I've tried many times, but without success, and I use C # not JS.

    I hope you can help me thank you very much in advance.:)
     
  48. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    494
    At this part instead of void OnCollisionEnter (Collision col) try to use void OnControllerColliderHit (ControllerColliderHit col)
     
  49. NSdesignGames

    NSdesignGames

    Joined:
    Dec 29, 2010
    Posts:
    494
    Drag and drop NetworkPlayer prefab to the empty scene, find GameObject called WeaponManager, it should have WeaponManager.cs attached.
    WeaponManager.cs have list called All Weapons, you can resize it and assign any weapon you want to player start with.
    When you done save prefab.
     
  50. BL Studios

    BL Studios

    Joined:
    Feb 18, 2014
    Posts:
    11
    I meant more or less a (weapons class). :)

    this is the situation, I have around +20 weapons "WeaponManager" but I want the players to choose only 5 of them, by "GUI", I tried something like this:

    Code (csharp):
    1.  
    2. public var PlayerWeapons : List.<WeaponScript>;
    3. public var weap1 : int;
    4. public var weap2 : int;
    5. public var weap3 : int;
    6. public var weap4 : int;
    7. public var weap5 : int;
    8.  
    9. void Awake()
    10. {
    11.  
    12. PlayerWeapons[0] = allWeapons[weap1] ;
    13. PlayerWeapons[1] = allWeapons[weap2] ;
    14. PlayerWeapons[2] = allWeapons[weap3] ;
    15. PlayerWeapons[3] = allWeapons[weap4] ;
    16. PlayerWeapons[4] = allWeapons[weap5] ;
    17.  
    18. void OnGUI()
    19. {
    20. if(GUI.Button(new Rect(15,100,100,25),"G36C"))
    21. {
    22. PlayerWeapons[0] = allWeapons[weap1] //G36c this in weap1
    23. }
    24. }
    25.  
    26.  

    that's an example of how I tried, I hope you can help me with this, since I am not very good with C # :sad:
     
unityunity