Search Unity

UFPS : Ultimate FPS [ RELEASED ]

Discussion in 'Assets and Asset Store' started by VisionPunk, Mar 9, 2012.

Thread Status:
Not open for further replies.
  1. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi michalss, These posts may be of some help. They contain a link to a rigged blender version of the arms without weapons:

    http://forum.unity3d.com/threads/12...era-RELEASED?p=1120141&viewfull=1#post1120141
    http://forum.unity3d.com/threads/12...era-RELEASED?p=1118672&viewfull=1#post1118672

    Cheers

    EDIT: All current versions of the arm in different formats: http://forum.unity3d.com/threads/12...era-RELEASED?p=1188553&viewfull=1#post1188553
     
    Last edited: Mar 12, 2013
  2. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi John,

    There is currently a bug with pausing, but if you have a decent scripting skills this FAQ article should help you get around that. If you manage to pause the game using timescale I think most timescale based pausing solutions should work.
     
  3. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    This should be done in the editor. For more info, read the manual chapter on FPSWeapon, along with the ones on the Preset and State system.
     
  4. x70x

    x70x

    Joined:
    Aug 20, 2011
    Posts:
    49
    Is there a way to limit the amount of time a player can use the run state? I want to only allow the player to run for a certain distance and then "recharge" their stamina by walking before they can run again, similar to Call of Duty. Similarly, can I change the max speed of the run state during gameplay? For example, if I wanted to allow the player to get progressively more tired over the course of the game and have their max run speed decrease slowly. Is this possible?
     
  5. Wrekk

    Wrekk

    Joined:
    Jul 16, 2012
    Posts:
    51
    Yes, there is. You just have to script it yourself. :)
     
  6. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    Nice one, I'm still working on the network layer.. Most stuff done so far, just working out if I can use A* Pathfinder to run the AI for a quick demo..

    I'm going to do Cartoon Soldier Vs Angry bots, soldiers being the players and the bots being AI driven. Also soldiers can shoot each other, just to make it interesting. Will post out the demo when ready, stuck a little for time at the moment..
     
    Last edited: Mar 6, 2013
  7. EliteMossy

    EliteMossy

    Joined:
    Dec 2, 2012
    Posts:
    513
    Is the new version out this month?
     
  8. bartleycollin

    bartleycollin

    Joined:
    Aug 1, 2012
    Posts:
    88
    Hi I was wondering 2 things. 1. How do I make it so when I'm crouching, and there is a surface directly above my head (crawling through a vent) that the camera doesn't go through the ceiling. 2. How do I trigger an earthquake. Thanks! I really do love this package!
     
  9. Lii-Kun

    Lii-Kun

    Joined:
    Aug 15, 2012
    Posts:
    2
    Hey a couple questions. Could someone explain in detail a good way to do 2 weapons at once and 3rd person camera? The FAQ kinda has some info on these but its not enough. Thanks in advance
     
  10. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    1) When you're going to emerge from crouch, use a ray cast or something to see if there's something above your head. If there is, don't proceed. You'll need to modify the UFPS code for this.

    2) Look in the demo included scene and find where it's triggered there and duplicate this in your code.
     
  11. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    These will require modification to the code. You'll have to run with what you're given in the documentation, because I'm not quite sure off of the top of my head what you'd do.
     
  12. Lii-Kun

    Lii-Kun

    Joined:
    Aug 15, 2012
    Posts:
    2
    Yeah I have some understanding of programming so I can change the code but I'm not sure where to start. Just need some advice in the right direction.
     
  13. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Can't wait :)
     
  14. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hey EliteMossy, See this FAQ answer.
     
  15. bartleycollin

    bartleycollin

    Joined:
    Aug 1, 2012
    Posts:
    88
  16. Midas89

    Midas89

    Joined:
    Feb 13, 2013
    Posts:
    13
    Hey guys.

    I can't get rid of this null refrence exception and it's really bothering me.

    It has been mentioned before on vp_FPSWeapon.SetPivotVisible (Boolean visible) in vp_FPSWeapon.cs

    I've been trying to figure out what it is that is the problem but can't find the source. Everything seems declared properly
     
  17. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Show a printout or screenshot from Unity. Give us a perspective of when it occurs. Does it crash the game, etc? We need this information - you don't provide it, we can't solve your issue.
     
  18. devfo

    devfo

    Joined:
    Jul 24, 2012
    Posts:
    49
    Is there any way to make a gun semi-automatic (one bullet per click, even if held down)? I looked through forum and couldn't find answer.
     
  19. Midas89

    Midas89

    Joined:
    Feb 13, 2013
    Posts:
    13
    It happens every i start the game. most of the times this result in the "no weapon" problem. I've had this problem ever since i implemented UFPSC , but now i'm working on solving some of my bugs, and this is a major one i needs solving. I read in the FAQ and in previous posts that this 9/10 times the no weapon bug is caused by this exception.
     
  20. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    Is it possible to make the crosshair to change texture when the current weapons is out of ammo? like in bioshock?
     
  21. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    Odd question, but is it possible to not use forward motion? Like you were at a shooting gallery in a Carnival type thing? Natural sideways movement is fine, but not forward?

    thanks,
    B.
     
  22. michalss

    michalss

    Joined:
    Feb 20, 2013
    Posts:
    5
    Can anyone export this into OBJ or FBX please ? Thx I dont use Blender using Maya
     
  23. 0n35

    0n35

    Joined:
    Aug 23, 2012
    Posts:
    51
    Hello, I would like to point out a glitch with this asset. I used the default prefabs (unchanged, except AA added to the camera on the player prefab)

    I've made a video demonstrating it here:

    Basically when box prefabs are close together they will completely glitch out, become unmovable and don't take damage from guns, they do however take damage from explosions, and once they've been exploded it seems they work fine, it's just that if they're all spawned at the same time they do this glitch, this could potentially be a bad thing, wanted to point this out.
     
  24. screenracer

    screenracer

    Joined:
    May 9, 2011
    Posts:
    112
    First off, thank you for such a great tool set. It works great. But we just ran into a sound issue. I was using one of the prefabs with tweaks to the settings to create my character.

    I am having a problem with Audio Listener. In the editor, they Audio Source's sound fine. But they play choppy when I run the game in the web player. The below video shows the issue I am having. I was able to narrow down that it was something in the FPS character when I removed it from the scene and added a simple camera to the scene near the audio source object. It no longer sounded choppy.

    Can you recommend a fix or know what the issue might be? Thanks!!!

     
    Last edited: Mar 11, 2013
  25. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Clipping Plane issues. When I build out for Android I get some nasty jagged effects sometimes, people have told me its the clipping planes. The near one needs to be increased, this does seem to have an effect but then when I do that when I run really close to walls I can see through them. Does any know anything about this? The jaggies on android are driving me crazy!
     
  26. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    Thank you very much for the nice clear instructions. Liked your bouncing thingy demo also!
     
  27. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Here's a burst fire mod that was sent to me a while back. I think maybe it can be used to achieve what you want (set burst count to 1 ?). Credits go to Matthieu Chane for this one.

    DISCLAIMER: I haven't written or even tested this code so I can't really answer questions about it. Just thought I'd share it since the author asked me to. Hope it's useful.

    file : vp_FPSPlayer.cs

    Code (csharp):
    1.  
    2. public class vp_FPSPlayer : MonoBehaviour
    3. {
    4.    
    5.     protected bool vp_WeaponCanShoot=true;                             // enable burst mode
    6.     protected int vp_WeaponBurstCount=0;                                 //Burst mode
    7.  
    8.  
    Then for fire press:

    Code (csharp):
    1.  
    2.     protected void InputFire()
    3.     {
    4.  
    5.         // fire button pressed / held down
    6.         if (Input.GetMouseButton(0))
    7.         {
    8.        
    9.             if (CurrentWeapon != null  vp_WeaponCanShoot==true)
    10.             {
    11.        
    12.                 //Check if the weapon is burst shooting
    13.                 if (CurrentWeapon.WeaponUseBurst==true)
    14.                 {
    15.                     //Save current weapon burst count
    16.                     if (vp_WeaponBurstCount==0) vp_WeaponBurstCount=CurrentWeapon.WeaponBurstCount;
    17.                     //Begin burst fire
    18.                     if (CurrentWeapon.WeaponBurstCount<1)
    19.                     {
    20.                         vp_WeaponCanShoot=false;
    21.                         return;
    22.                     }
    23.                 }
    24.  
    And fire release:

    Code (csharp):
    1.  
    2.     // fire button released
    3.         if (Input.GetMouseButtonUp(0))
    4.         {
    5.             //Restore weapon burst count
    6.             if (CurrentWeapon.WeaponUseBurst==true)
    7.             {
    8.                     vp_WeaponCanShoot=true;
    9.                     CurrentWeapon.WeaponBurstCount=vp_WeaponBurstCount;
    10.             }
    11.  
    12.  
    File : vp_FPSWeapon.cs

    Code (csharp):
    1.  
    2. public class vp_FPSWeapon : vp_Component
    3. {
    4.  
    5.      
    6.     //Weapon fire selection
    7.     public bool WeaponUseBurst = false;                // Is the weapon automatic or burst ?
    8.     public int WeaponBurstCount = 3;                // Number of bullet to shoot per burst
    9.  
    File : vp_FPSWeaponEditor.cs

    $Sans titre.jpg

    Code (csharp):
    1.  
    2. public class vp_FPSWeaponEditor : Editor
    3. {
    4.  
    5.  
    6.     // weapon foldouts
    7.     private static bool m_WeaponFireSelectorFoldout;
    8.  
    Then gui:

    Code (csharp):
    1.  
    2.     if (Application.isPlaying || m_Component.DefaultState.TextAsset == null)
    3.         {
    4.            
    5.             // --- Fire Method ---
    6.             m_WeaponFireSelectorFoldout = EditorGUILayout.Foldout(m_WeaponFireSelectorFoldout, "Fire selection");
    7.             if (m_WeaponFireSelectorFoldout)
    8.             {            
    9.                 m_Component.WeaponUseBurst = EditorGUILayout.Toggle("Use Burst fire", m_Component.WeaponUseBurst);    
    10.                 m_Component.WeaponBurstCount = EditorGUILayout.IntField("Burst size", m_Component.WeaponBurstCount);
    11.                
    12.                 vp_EditorGUIUtility.Separator();
    13.             }
    14.  
    file : vp_FPSShooter.cs

    Code (csharp):
    1.  
    2.     public void Fire()
    3.     {
    4.  
    5.         //Update burst ammo count
    6.         if (m_Weapon.WeaponUseBurst==true) m_Weapon.WeaponBurstCount=m_Weapon.WeaponBurstCount-1;
    7.  
    8.  
     
    Last edited: Mar 12, 2013
  28. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Yeah that's possible with very basic scripting. The crosshair is rendered in vp_FPSCrosshair.cs. Here's one approach:

    1. Add a second texture variable at the top of the crosshair script.
    2. Also, add a public GameObject variable "Player".
    3. In the editor, drag your FPSPlayer into the "Player" slot that appears on the crosshair component in the Inspector.
    4. In the OnGUI() method, check the "Player.Camera.CurrentShooter.AmmoCount" variable and modify the logic draw the correct texture depending on ammo state.
     
  29. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Yeah, that's super easy. Just modify the controls in vp_FPSPlayer.cs. You can also easily lock the player to one axis via script.
     
  30. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Last edited: Mar 12, 2013
  31. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Glad you like it :)
     
  32. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    thanks, on35. I'll have to look into this!
     
  33. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi, screenracer. My best guess is that it's a garbage collector (memory) issue. Does it still happen after closing and restarting the editor? Perhaps you can draw some conclusions from the Profiler output?
     
  34. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi radiantboy,
    I need a bit more info, especially a screenshot. Also, what are the events leading up to this this issue appearing?
     
  35. screenracer

    screenracer

    Joined:
    May 9, 2011
    Posts:
    112
    Thank you for the reply. While using the unity editor, I can click play and run the program without any sound issues.

    It seems to only an issue when we deploy the web browser version. I compiled a PC exe and I have no sound issues.
     

    Attached Files:

  36. LightSky

    LightSky

    Joined:
    Aug 12, 2012
    Posts:
    45
    I saw that you had a working demo of moving platforms: http://vimeo.com/60591696
    The demo level doesn't have a platform like this. Is this coming in the next update or is there a way to implement this?
     
  37. Jasper-Hesseling

    Jasper-Hesseling

    Joined:
    Jul 27, 2009
    Posts:
    34
    Hi mr Visual Punk,

    First of all amazing Prefab, I wish most of them are as rigid as this one, I mean I created exploding things in no time and I am a visual guy and not a programmer. I was not aiming for it but hey what is wrong with a little bit of fun. Anyway there is one issue that I ran in to, it's probably asked before but you know how search functions are in fora... I want some assets with colliders not to receive the impact decal such as the water surface, bullet holes in water don't work very well... Is there someway you can put it on a layer to cancel this effect or even give it a class so you can create splashes or have classes like wood or stone etc.? Hope that my question still makes sense now...
     
  38. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    That's pretty cool, but I'm sure we're going to have to code it ourselves.
     
  39. devfo

    devfo

    Joined:
    Jul 24, 2012
    Posts:
    49
    This is an easy fix! As described in TryHarder's post on bullet penetration, all you need to do is goo into the vp_Layer script and add a new layer. In this case, it would be something like this...

    // layers
    public const int Weapon = 31;
    public const int Player = 30;
    public const int Debris = 29;
    public const int Props = 28;
    public const int Water = 50;
    public const int None = 0;

    Then add the layer "Water" to the layers tab in Unity itself (Make sure that you put the layer "Water" on the layer you put it in on the actualy script. In this case, I put it on layer 50). Then all you have to do is add another raycast object to the Start() function in vp_Bullet. In your case, it would be something like this:

    if(Physics.Raycast(ray, out hit, Range, ~((1 << vp_Layer.Player) | (1 << vp_Layer.Debris) | (1 << vp_Layer.Water))))

    Hope I helped!
     
    Last edited: Mar 13, 2013
  40. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Ok yeah the web player can be more sensitive to performance issues. I'd do a little research around the forums and Unity Answers regarding choppy sound in the Unity webplayer in general. The sound doesn't chop in my webplayers and this is the first report I've gotten about it, so it is probably an issue of how your application behaves in combination with UFPS performance wise, which makes it hard for me to provide a quick answer here. Again, it is a good idea to take a thorough look at this using profiling. Once I've shipped v1.4 I'll have some more time to have a look at your project if you'd like to send it to me.
     
  41. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    The next release will not have this feature. Actually, the video wasn't done by me - it's courtesy of Caleb Cohoon, who has been nice enough to share the implementation details HERE.
     
    Last edited: Mar 14, 2013
  42. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi Jasper. This FAQ answer might help you out.
     
  43. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hey, thanks devfo :)
     
  44. Jasper-Hesseling

    Jasper-Hesseling

    Joined:
    Jul 27, 2009
    Posts:
    34
    Thanks devfo, That did the trick. The vp_Layer script wasn't in the manual or I missed it... But it made sense.
     
  45. devfo

    devfo

    Joined:
    Jul 24, 2012
    Posts:
    49
    Glad I could help!
     
  46. kaiber

    kaiber

    Joined:
    Mar 4, 2013
    Posts:
    15
    I'm a proud owner of your FPS Camera and have it working very nicely in my network fps. I was wondering when the new verison is coming out? I reaaaly want to see your implementation of the melee stuff you mentioned before.

    I could try and do it myself, but you made it sounds pretty impressive. Depends how long the wait is before the new version I guess ;)
     
  47. nosyrbllewe

    nosyrbllewe

    Joined:
    Oct 18, 2012
    Posts:
    182
    I looked at his code, and the implemation is very easy. It only requires a couple lines of code. If it is this easy, then why won't you put it in the next release?
     
  48. calebhc

    calebhc

    Joined:
    Feb 11, 2013
    Posts:
    13
    Hi nosyrbllewe,

    I'm the guy who implemented the moving platform code and it's not a full, proper implementation. :) It was just something I quickly coded up for a game I'm working on based off of the code in the Character Motor script. I'm sure when the Ultimate FPS Camera has official platform support it will be much better since more edge testing will go in to it and it will have more features. Probably like supporting rotations and adjusting the player's velocity when jumping off, etc. So a good implementation will be more advanced than this. :)

    - Caleb
     
  49. lusho_games

    lusho_games

    Joined:
    Jun 4, 2011
    Posts:
    63


    Anybody has experience with picking up weapons? and enabled them?

    It is very common to start the game with no weapons. I made a manager but it doesn't work, I don't want to have prefabs of the player with weapons equipped, etc.

    thanks.
     
  50. nosyrbllewe

    nosyrbllewe

    Joined:
    Oct 18, 2012
    Posts:
    182
    Hi,
    The video made your code probably look a lot better than it actually was. I didn't realize the limitations to your code, but at least Cal said that he will eventually add support for it.
     
Thread Status:
Not open for further replies.