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. Andy_

    Andy_

    Joined:
    Dec 12, 2013
    Posts:
    80
    Hi paulojsam,
    See the chapter about melee attack debug objects in the online manual:
    Debug objects
     
  2. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Hey,

    Is there anyway to move the player through code and have him look at specific points while still using the cameras bob/swaying stuff? Essentially, I want to have slight cutscenes but I don't want there to be a difference between the movement coming from the player and the movement coming from the cutscene. For example: if the cutscene has the player walking forward, and he has to look left, then the camera should continue to bob while to rotates to the correct position ...

    I'm sure I'm not the first person asking this, but I dont have time to sift through 66 pages :).

    Thanks!
     
  3. Andy_

    Andy_

    Joined:
    Dec 12, 2013
    Posts:
    80
    Hi DGordon,
    Perhaps this link can help: How the 'Action Hero' mode works
     
  4. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Thanks, I'll dig into it when I have the time. Glad to see there's something out there :).
     
  5. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I am trying to set up a jet-pack. The code below works fine except I only get one thrust. I cannot toggle the 'thrust' mid flight. I'm assuming it has to do with whether or not the player has been grounded and CanStart_Jump. How can I work that out. Also, I haven't worked out differentiating between tapping the spacebar to jump and holding it down to use the jet pack. I'm thinking a timer between getkeyDown and getkeyUp or something unless there is a better way, thoughts? Thanks.

    Code (CSharp):
    1.         if (Input.GetKey ("space")) {
    2.                         if (PlayerCameras [0].activeSelf) { // i create an array of cameras, UFPS is the first one
    3.                                 FPcontroller.PhysicsGravityModifier = 0.0f;
    4.                                 FPcontroller.MotorFreeFly = true;
    5.                                 FPcontroller.MotorAcceleration = .25f;
    6.                         }
    7.                 } else {
    8.                         FPcontroller.PhysicsGravityModifier = 0.2f;
    9.                         FPcontroller.MotorFreeFly = false;
    10.                         FPcontroller.MotorAcceleration = 0.1f;
    11.                 }
     
  6. Andy_

    Andy_

    Joined:
    Dec 12, 2013
    Posts:
    80
    Hi topofsteel, this post in the official forum discusses adding force to the jumps:
    Perhaps you can extract some useful info from that solution
    Add force on every jump? aka. strafe jump
     
  7. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    I'm having issues with zooming. I have no idea how this issue came up or what I did to trigger it.

    The problem is that whenever I zoom, my rotation goes to 0,0,0 rather than staying at the same rotation. Any help would be great.

    [EDIT]
    I managed to fix it by simply re-importing the vp_FPCamera script.
     

    Attached Files:

    Last edited: Feb 13, 2015
  8. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    What's the best way to save inventory between playing sessions so the player will continue with the same amount of ammo? Thanks!
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    The Dialogue System for Unity has integration with UFPS. As part of the integration, it saves and loads weapons, ammo, stats, etc., between sessions and levels. Here's how it's implemented:

    For stats, it grabs vp_FPPlayerEventHandler and uses Health.Get() and Health.Set(), etc.

    For inventory (weapons and ammo), it loops through vp_Inventory.m_ItemCapInstances. For each item, it checks the type:
    • vp_UnitBankType (loadable weapon like a pistol): Gets vp_Inventory.GetItemCount(). Also, for the number of rounds loaded in the weapon, finds the instance in vp_Inventory.UnitBankInstances and gets its Count.
    • vp_UnitType (ammo): Gets vp_Inventory.GetUnitCount().
    • Otherwise (ammo-less weapon like a mace): Gets vp_Inventory.GetItemCount().
    It also saves the currently-equipped weapon index from vp_FPWeaponHandler.CurrentWeaponIndex, and the inventory limits from vp_Inventory.TotalSpace, UsedSpace, and RemainingSpace.

    Restoring inventory uses:
    • vp_UnitBankType: TryGiveUnitBank() or TryRemoveUnitBanks() depending on what the current count is versus the saved count. And sets UnitBankInstance.Count for the amount of ammo loaded in the weapon.
    • vp_UnitType: TrySetUnitCount().
    • Otherwise: TryGiveItems() or TryRemoveItems().
    It also needs to restore the currently-equipped weapon. It sets vp_FPWeaponHandler.ReloadAutomatically temporarily false. Then it calls vp_FPPlayerEventHandler.SetWeapon.TryStart(current-weapon-index) and vp_FPWeaponHandler.CurrentWeapon.GetComponent<vp_FPWeapon>().Wield(true), and once those complete, it sets ReloadAutomatically back to its original value.
     
    boysenberry likes this.
  10. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Thanks for the detailed help! I've gotten it pretty much working now.
     
  11. LeftyTwoGuns

    LeftyTwoGuns

    Joined:
    Jan 3, 2013
    Posts:
    260
    Quick question:

    What controls the part of the muzzle flash that lights up the whole screen? I'm using the pistol on the SimplePlayer and the flash is pretty intense and whites out the whole screen. I messed with the Intensity setting for the Muzzle Flash on the pistol but it didn't effect that
     
  12. SwabbyNat74

    SwabbyNat74

    Joined:
    Oct 27, 2014
    Posts:
    17
    Any release date for the 64-Bit/IL2CPP compatible version of the plugin? UFPS is our last hurdle to finishing off a branded game we've got working great, just no UFPS player, etc. in the scene --> build.

    Timeline?
     
  13. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    For some reason, when I assign bullet (unit) to a gun (unit bank) I can't reassign it later - it always defaults to the first ammo I gave it. Now, granted, it may have been something I did, since I edited the code a lot, but I can't seem to find where this would be happening. Has anyone else encountered this? Is that intentional? It does pick up the icon for the ammo I want it to use but not the actual ammo.

    And another thing: what's the best way to use the animation on a child?
     
    Last edited: Feb 20, 2015
  14. Andy_

    Andy_

    Joined:
    Dec 12, 2013
    Posts:
    80
    Hello NatAA,

    The problem is a Unity wide issue and not within UFPS.

    We have investigated the issue. As it turns out, these are likely bugs in Unity 4.6.2 and not in UFPS: According to Unity, their intention is for anything that builds successfully with regular Mono to build on IL2CPP without a problem. If it doesn't, they say it's a bug in Unity that they want reported.

    In our tests, the asset builds fine to an iPad Air in Mono-mode, but not in IL2CPP mode. Unfortunately it seems IL2CPP is in an early state and I see a number of developers are having trouble updating their games and assets. At the moment, the only thing we can do is to summarize any issues with IL2CPP + UFPS and let Unity know about them.

    Timeline is impossible for us to answer, but the good news is Unity will be releasing patches in the coming weeks to fix problems with IL2CPP. I strongly recommend keeping an eye on the following page for Unity patches, and to try every new release with UFPS to see when it works.

    http://unity3d.com/unity/qa/patch-releases

    For more info about the state of IL2CPP, please see this page:

    http://forum.unity3d.com/threads/4-6-ios-64-bit-beta.290551

    Quick note: This issue does not affect _testing_ on an iOS device (you can still build without IL2CPP) and it does not affect Android. It only becomes a problem when you wish to submit to the App Store, and hopefully this limitation will be fixed by Unity in the weeks to come.

    We are sorry about this but unfortunately it's out of our hands.
     
  15. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Hello,
    first Im really sorry if this has been discussed, I'm a UFPS noob...
    I'm having an issue where i cannot turn my right gamepad or mouse rotation until I click the window with my mouse.
    My vertical and horizontal movements work without having to touch the game.
    Thanks!
     
  16. rob535

    rob535

    Joined:
    Dec 13, 2013
    Posts:
    18
    Hi HeadTrip, I just wrote a simple script called CursorLock.cs, and attach it to a gameobject. Here is the code if you want it.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class CursorLock : MonoBehaviour {
    5.  
    6.     public bool LockHeroCursor = true;
    7.    
    8.     // Use this for initialization
    9.     void Start () {
    10.         vp_Utility.LockCursor = LockHeroCursor;
    11.     }
    12. }
     
  17. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Thanks! I appreciate it
     
  18. gamedev.eric

    gamedev.eric

    Joined:
    Feb 21, 2015
    Posts:
    4
    It looks so amazing. Would be perfect for my game.
     
  19. onemoreuser091

    onemoreuser091

    Joined:
    Nov 15, 2014
    Posts:
    14
    How can I have footsteps on a mesh terrain without using 100+ surface identifier?
    The terrain mesh I use has a splat map texture too,so with the code below I can know which color is a different texture. But how can I merge or extend this code to work with the current footstep manager?

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class TextureColor : MonoBehaviour {
    5.  
    6.         void Update() {
    7.             if (!Input.GetMouseButton(0))
    8.                 return;
    9.          
    10.           RaycastHit hit;
    11.           if (!Physics.Raycast(camera.ScreenPointToRay(Input.mousePosition), out hit))
    12.               return;
    13.          
    14.           Renderer renderer = hit.collider.renderer;
    15.           MeshCollider meshCollider = hit.collider as MeshCollider;
    16.           if (renderer == null || renderer.sharedMaterial == null || meshCollider == null)
    17.             return;
    18.          
    19.             Texture2D tex = (Texture2D)renderer.material.GetTexture ("_Control");
    20.             Vector2 pixelUV = hit.textureCoord;
    21.             pixelUV.x *= tex.width;
    22.             pixelUV.y *= tex.height;
    23.             Debug.Log( tex.GetPixel( (int)pixelUV.x,(int)pixelUV.y).ToString());
    24.  
    25.         }
    26.     }
     
  20. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Good afternoon. I saw in the interenet advertising that anyone who buys UFPS receive the same supplement Ultimate FPS Photon Multiplayer Starter Kit. I bought it today but not found. Where can I find it ?? I'm bought just for multiplayer !!!
     
  21. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    @onemoreuser091 : Good news: this is already supported in UFPS! So no need to write scripts for playing sounds depending on splat texture. Check out DemoScene3. The character makes gravel footstep sounds on the gravel texture, and grass sounds on the grass texture. What you need to do is hook just up the correct textures and sounds. Check out the footstep manager tutorial.

    @Alex3333: Hmm, this is not accurate since the multiplayer starter kit for UFPS will be a separate add-on product (release: late March 2015). For more info see this page. Where did you see that advertising?
     
  22. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    I'd like to give a big fat thanks to @Andy_ who has been helping out here with support since December 2013! Good luck on the new game studio job, Andy :) ...

    Also, a big welcome to @vp_Tommy & @vp_Steve, two new VisionPunk team members who will boost the support effort moving forward!

    Cheers guys ...
     
    Last edited: Mar 2, 2015
  23. vp_Tommy

    vp_Tommy

    Joined:
    Mar 1, 2015
    Posts:
    15
    Thanks for the welcome, @VisionPunk , I look forward to it!
     
  24. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    they are also working on MP beta ?:rolleyes:
     
  25. vp_Tommy

    vp_Tommy

    Joined:
    Mar 1, 2015
    Posts:
    15
    @Damien Delmarle Mostly in support role, though we do participate in the MP beta
     
  26. onemoreuser091

    onemoreuser091

    Joined:
    Nov 15, 2014
    Posts:
    14
    I'm sure I didn't explain correctly. I used a normal terrain and it was working. But when I converted it to a mesh it stop working because the footstep manager only reads from a terrain data but the mesh don't have this just the Control texture which maps the others textures.
    The mesh:

    And the footstep manager with the same grass textures but not working...
     
  27. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    @onemoreuser091 : Ok I see. Yeah you're right. The footstep manager supports 3 cases: objects with a single main texture, objects with a surface identifier component, and standard Unity terrains. I see you are using a third party terrain system. Unfortunately we have not had the time to make this system work with all the terrain systems out there, although this would ofcourse be awesome when we have time. For now, I recommend asking the developer of that terrain system for a way to sample the dominant texture at a specific coordinate, and then to modify the footstep manager script in UFPS to use that method instead of the Unity one. Should be quite easy once you know what method to use. Hope this helps.
     
  28. LeftyTwoGuns

    LeftyTwoGuns

    Joined:
    Jan 3, 2013
    Posts:
    260
    Well Unity launched a sneaky Unity 5 release today- is UFPS still compatable?
     
  29. vp_Tommy

    vp_Tommy

    Joined:
    Mar 1, 2015
    Posts:
    15
    Hi @LeftyTwoGuns UFPS is compatible with Unity 5. Upon import, however, there will be prompt to convert some deprecated API and upon conversion will work. As Unity 5 has just been released, UFPS will not have all the bell and whistle yet, especially with the current focus on multiplayer. A hot fix will out soon to address the API issue.

    Regards
     
  30. Armageddon104

    Armageddon104

    Joined:
    Sep 14, 2014
    Posts:
    23
    I'm wondering if anyone else encountered this problem. When you jump and hit a ceiling, after you land you can't jump again until half a second has passed. It's very jarring and I'd like to immediately continue jumping like all other times when you don't hit the top of the character controller to a ceiling. Also is it possible to remove that huge screen shake when hitting ceilings?

    -Thanks
     
  31. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,764
  32. vp_Tommy

    vp_Tommy

    Joined:
    Mar 1, 2015
    Posts:
    15
    Hi @Armageddon104 this is build in by default into UFPS. You can definitely change this behaviour to best suit your game, however this requires changing the scripts. There are two components to tweak to get rid of this effect.

    • In vp_FPController, in line 366, you will find this lines of code. What you will need to do remove that first few lines of code.
    Code (CSharp):
    1.     protected virtual void UpdateJump()
    2.     {
    3.  
    4.         // remove the below code as it will cause the "delay" when you jump and hit the ceiling.
    5.         if (m_HeadContact)
    6.             Player.Jump.Stop(1.0f);
    7.  
    8.         if (!MotorFreeFly)
    9.             UpdateJumpForceWalk();
    10.         else
    11.             UpdateJumpForceFree();
    12.  
    13.         // apply accumulated 'hold jump' force
    14.         m_MotorThrottle.y += m_MotorJumpForceAcc * Time.timeScale;
    15.  
    16.         // dampen forces
    17.         m_MotorJumpForceAcc /= (1.0f + (MotorJumpForceHoldDamping * Time.timeScale));
    18.         m_MotorThrottle.y /= (1.0f + (MotorJumpForceDamping * Time.timeScale));
    19.  
    20.     }
    • In vp_FPCamera, in line 1059, you can remove the code here to take away the twisting effect when you hit the ceiling.
    Code (CSharp):
    1.     protected virtual void OnMessage_HeadImpact(float impact)
    2.     {
    3.         // remove the below code to disable the camera twisting.
    4.         if ((m_RotationSpring != null) && (Mathf.Abs(m_RotationSpring.State.z) < 30.0f))
    5.         {
    6.  
    7.             // apply impact to camera rotation spring
    8.             m_RotationSpring.AddForce(Vector3.forward * (impact * 20.0f) * Time.timeScale);
    9.  
    10.         }
    11.  
    12.     }
    Hope this helps you. Apologies for the slow reply.
     
  33. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
  34. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    This reply might not be spot on, but since nobody else has responded:

    Have you pressed the apply button near the top of that GameObjects inspector in order to update the prefab?

    Also one of the release notes for the 2nd patch release of Unity 5 mentions a potentially relevant change:

    https://unity3d.com/unity/qa/patch-releases
     
  35. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I dont know. I've been adding effects to the UFPS prefabs for years without needing to modify the prefab.
     
  36. Gunhi

    Gunhi

    Joined:
    Apr 18, 2012
    Posts:
    300
    Could you please estimate the date for Multi-Player feature? is it a separate or included add-on?
    If so, does it work with Photon or built-in network?
     
  37. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    Yea... Who knew, but that was it, thanks!
     
  38. Gunhi

    Gunhi

    Joined:
    Apr 18, 2012
    Posts:
    300
    Need a tutorial how to make "headshoot" for weapons and sniper behaviour!
     
  39. MLow

    MLow

    Joined:
    Mar 2, 2011
    Posts:
    35
    UFPS doesn't come with any examples for enemies does it? Once you set up an enemy it should be pretty trivial to have a case for different hit boxes.
     
  40. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
  41. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    A headsup that UFPS is currently on a spring sale of 50% (regular price: $95)!
    If you haven't already, this is a great opportunity to get it from the Asset Store.

     
  42. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    188
    @VisionPunk There is something weird going around in the Webdemo. When I died 3 times and also respawned, and you look down on the ground the PlayerController starts to shake (pretty huge) for an unknown reason. Any idea why this is happening? Or is it already fixed?
     
  43. suctioncup

    suctioncup

    Joined:
    May 19, 2012
    Posts:
    273
    Hello, I remember buying this when it first came out - and it was amazing even then.

    Is it possible to use this player prefab and program in a grappling hook? I could not get it to work, even with the rigidbody first person controller.

    Thanks.
     
  44. Gunhi

    Gunhi

    Joined:
    Apr 18, 2012
    Posts:
    300
    is this version 1.5 with update Multi-Player Photon?
     
  45. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    That's a separate add-on asset. Look in the Asset Store for it.
     
  46. vp_Tommy

    vp_Tommy

    Joined:
    Mar 1, 2015
    Posts:
    15
    @Justice0Juic3 I have tested the latest webplayer demo, and I could not replicate the bug. Have you tried the demo on your end? You could try it out here

    Hi @suctioncup yes you are able to make a grappling hook with a little bit of scripting. UFPS does not come with it by default but it is definitely doable, though I am not entirely sure if it's possible with rigidbody first person controller, as UFPS has it's own physics for character movement.

    @Gunhi as @OnePxl mentioned, UFPS 1.5.0 update is meant to be compatible with the recently released UFPS MP Photon add-on. The UFPS MP add-on is however, a separate add-on though it is currently heavily discounted, as it is still in beta stage. You can find out more about UFPS MP here and also the planned roadmap here
     
  47. Pauloxande

    Pauloxande

    Joined:
    Feb 8, 2014
    Posts:
    110
    Look this photo.
    The AI shoot me, but the shot goes the other way
    Do you know how to solve this
     

    Attached Files:

  48. vp_Tommy

    vp_Tommy

    Joined:
    Mar 1, 2015
    Posts:
    15
    Hi @Pauloxande , I could not be sure, but it seems the AI you are using is a different solution from UFPS? In that case, is the issue replicated in the initial default install? As I do not understand which AI solution it is, it could best to contact the AI asset author regarding this.
     
  49. john-essy

    john-essy

    Joined:
    Apr 17, 2011
    Posts:
    464
    Hi mate,

    Your package is just sweet, the more i play the more i see things i can change which is just epic. I got your multiplayer asset also which is great.

    I have a problem when i am using asset bundles to bundle up my scenes then extract them from the server. When loading the scene it unpacks everything that is in it etc.

    But i am getting errors on fpweapon
    NullReferenceException --> vp_FPWeapon.cs:267)

    Which is the Shade.find which im not sure i can do so i commented it out.

    Then tried again and got an error on line 365 Update Swaying But i have no idea what this could be, They are all missing reference exceptions which tells me something of course is mising but was wandering if you know anything about things like this before i delve in and rip my hair out lol, do you have any idea? Also do you have a contact email? or some other means rather than here?

    Thanks

    Jonh
     
  50. Pauloxande

    Pauloxande

    Joined:
    Feb 8, 2014
    Posts:
    110
    I using
    Shooter AI – The Ultimate Artificial Intelligence Solution
     
Thread Status:
Not open for further replies.