Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Realistic FPS Prefab [RELEASED]

Discussion in 'Assets and Asset Store' started by Azuline-Studios, Apr 5, 2013.

  1. Dionysos1111

    Dionysos1111

    Joined:
    Feb 14, 2016
    Posts:
    38
    @JACKO4590 Thanks for you're reply, i already tried to integrate ICE, ICE also have an integration for RFPS but i'm making a mobile game and having ICE and RFPS together is to heavy for mobile. which one would you suggest for mobile then, behavior designer or tactical shooter AI?

    I only use zombies so i don't require any shooting AI's.
     
  2. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    76
    Well I haven't done any research on mobile friendly assets as I'm not developing on there but maybe the basic RFPS AI might be the easiest. An update for this is about to come out soon according to azuline from page 65 so maybe they will add a few tweaks otherwise try editing the code yourself and see if you can make it work.
     
  3. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    162
    Your web demo link tries to download the demo rather than play it in browser. Can that be fixed?
     
  4. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    76
    @maxaud i don't think that's what is happening. Maybe it's downloading the plugin for it to work? Unity web players need a plugin downloaded and installed on your computer before allowing the game to run. Once it's installed you won't need to do it again.

    Unless something has changed as I'm at work ATM and can't test this for you.

    What is the file name for the download?
     
  5. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    162
    It tries to download the .html file from Drop Box rather than play it. I can play many other Unity demos in the browser. This is due to a change in how dropbox handles files.

    filename = RFPSP.html
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    Dropbox and Google Drive recently disabled hosting of websites/HTML. Maybe @Azuline-Studios can move the demo to a different host.

    @maxaud - In the meantime you could download the html and unity3d files and open the html file locally.
     
    JACKO4590 likes this.
  7. Locky

    Locky

    Joined:
    May 14, 2015
    Posts:
    86
    Is there a setting or a quick code change that can be made so that the bow and arrow has an arrow without actually pulling back? Or does this require redoing the animation?
    Thanks.
     
  8. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    76
    There was a autosave script in this thread (pretty sure it was using dialog system for saving), was wondering if anyone have it handy or know what page it was on. For the last 3 days i'v been picking a random 10 pages and going though them but not getting far fast.

    Thanks in advance
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    That post was hiding over on the Dialogue System thread. Here's a link.
     
  10. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    558
    Hey here is a simple saving system I'm using for player settings, I'd also recommend using easy save, it has auto save feature and has encryption;

    Code (CSharp):
    1. void start()
    2. {
    3. SetupSettings();
    4. }
    5.  
    6. private void SetupSettings ()
    7.     {
    8.         LoadGameManagerSettings ();
    9.  
    10.         PlayerGodMode ();
    11.     }
    12.  
    13.     public void PlayerGodMode()
    14.     {
    15.         if (GodModeToggle.ison) {
    16.             //DO ACTION
    17.         } else {
    18.             //DO ANOTHER ACTION
    19.         }
    20.     }
    21.  
    22.     private void LoadGameManagerSettings ()
    23.     {
    24.         if (PlayerPrefs.GetInt ("GameManagerSettings") == 1) {
    25.  
    26.             ZoomModeSlider.value = PlayerPrefs.GetInt ("ZoomModeSlider");
    27.  
    28.             int
    29.             toggle = PlayerPrefs.GetInt ("GodModeToggle");
    30.             if (toggle == 1) {
    31.                 GodModeToggle.isOn = true;
    32.             } else {
    33.                 GodModeToggle.isOn = false;
    34.             }
    35.  
    36.             StaminaRegenTimeSlider.value = PlayerPrefs.GetFloat ("StaminaRegenTimeSlider");
    37.  
    38.             } else {
    39.             Reset_GameManagerSettings ();
    40.         }
    41.     }
    42.  
    43.     public void Reset_GameManagerSettings ()
    44.     {
    45.         GodModeToggle.isOn = false;
    46.  
    47.         ZoomModeSlider.value = 0f;
    48.  
    49.         StaminaRegenTimeSlider.value = 5.0f;
    50.  
    51.         SaveGameManagerSettings ();
    52.     }
    53.  
    54.     private void SaveGameManagerSettings ()
    55.     {
    56.         PlayerPrefs.SetInt ("GameManagerSettings", 1);
    57.  
    58.         PlayerPrefs.SetInt ("ZoomModeSlider", Mathf.RoundToInt (ZoomModeSlider.value));
    59.  
    60.         int toggle = 0;
    61.  
    62.         if (GodModeToggle.isOn)
    63.             toggle = 1;
    64.         else
    65.             toggle = 0;
    66.         PlayerPrefs.SetInt ("GodModeToggle", toggle);
    67.  
    68.  
    69.         PlayerPrefs.SetFloat ("StaminaRegenTimeSlider", StaminaRegenTimeSlider.value);
    70.     }
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    Thanks! The Dialogue System's save integration for RFPS saves stats and inventory, but I didn't think to include settings like GodModeToggle. I'll include that in the next release. In the meantime, ||JIMBOB||'s suggestion to use Easy Save is good, too. You can use Easy Save with the Dialogue System if you want to include stats, inventory, position, etc., in saved games.
     
    llJIMBOBll likes this.
  12. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    162
    It says missing data file when trying this.
     
  13. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    558
    RFPS / Inventory Pro v2.4 latest (It is deprecated, but this is for ppl who have old version. I will make a new demo tomorrow night for v2.5 latest, altho you only need to change some namespace names, and change the inventory audio. basically add using devdog.general; at the top )

    https://drive.google.com/file/d/0BwHnbBuRZU8kaDgtYUxQY2wzSE0/view?usp=sharing

    :D

    Includes a Demo scene with everything setup, includes all scripts to make it work with Inventory Pro v2.4 latest.

    Includes a Demo Items Database with a few items setup.

    Handles Player mouse too, you can set to hide weapon if the inv window is open.

    DOES NOT Include any scripts or assets from either RFPS or Inventory Pro.
     
    Weblox, Hormic, arnesso and 1 other person like this.
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
  15. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Few questions here:
    1) Anyone know of a way to change weapon/ammo/health pick ups to collision based instead of going up to them and pressing the use key?
    2) I'm also curious if possible to replace the sword and shield for a gun and shield? Any tips would be super appreciated!
    3) Where do I change the barrel explosion particle? I'm trying to find where it's located in the index, so far no luck :( (trying to make a new rocket for the rocket launcher - so not sure how to apply the scripts/particle properly)
    4) Finally, how do I edit the text info when users see the F1 tool tip when the scene starts?
     
    Last edited: Oct 29, 2016
  16. EvilGremlin

    EvilGremlin

    Joined:
    Aug 12, 2016
    Posts:
    213
    Have you looked at Adventurer's Toolkit? I've just started with it but it seems to have some useful tools for dealing with moving platforms.

    https://www.assetstore.unity3d.com/en/#!/content/22179
     
  17. Seriously

    Seriously

    Joined:
    Jun 15, 2013
    Posts:
    9
    How do you move the player camera height in first person mode? I've searched the forums here, but there are just too many posts now to find the answer. I can't find an option in the scripts either. Please help if you can.
     
    Last edited: Oct 29, 2016
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    This post.

    FPS Main > FPS Weapons has a Weapon Effects component. The explosion prefab is assigned to the Explosion field.

    Edit Scripts > HUD > HelpText.txt.

    FYI in case someone else is wondering: FPSRigidBodyWalker > Camera and Capsule Collider Heights > Eye Height.
     
    Seriously and RangePlusOne like this.
  19. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Is this what you're looking for?
    https://gyazo.com/731393d71877d016a1bcad2ffea31971
     
    Seriously likes this.
  20. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    thanks for the quick response time! What if I wanted to have multiple explosion types? I also notice a lot of these particles are listed as Ellipsoid Particle Emitter that comes with a warning saying it's part of the legacy particle system which will be removed. So are these just temporary place holders just for the time being and devs are expected to use the ParticleSystem components that come with Unity 5?

    How do I modify the buttons that appear when the user hits escape?
     
    Last edited: Oct 29, 2016
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    Looks like you'd have to edit the ExplosionEffect() method of the WeaponEffects.cs script. Or add another script such as CharacterDamage that can instantiate a prefab when the GameObject "dies". In this case, you could instantiate another explosion prefab.

    My guess is that @Azuline-Studios will update this in the next release to support the new particle system. In the meantime, you can edit WeaponEffects.cs, or just continue using the legacy particle system since it's still available.

    Edit the script RFPSP > Scripts > HUD > MainMenu.cs.
     
  22. Seriously

    Seriously

    Joined:
    Jun 15, 2013
    Posts:
    9
  23. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Last edited: Oct 31, 2016
  24. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    196
    Thanks very much for the reply and the pointer link. I checked that out and looks like some helpful things in the asset. At the moment I sorted my immediate need for a vertical elevator platform as I needed it to work by editing the default RFPSP platform code and the positioning and placement of the object and child parts in editor. That should also work for my drop ship too - though I have not yet linked to a trigger to activate when player gets on them only. I am sure I can do that to one way or another - though the Adventurer's Toolkit? looks like it might make things easier and extend what I can do now with things I have use for which would be a benefit. I may get it or similar later as I will also need other things .e.g. a level of cut scene management provided therein. and more...

    Anyway thanks again for the reply and helpful pointer.

    Kind Regards

    Peter
     
  25. polash

    polash

    Joined:
    Jul 8, 2015
    Posts:
    46
    @TonyLi Hello, need a little help for my RFPS futuristic project. i write a code but not working..
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4.  
    5. public class Timer : MonoBehaviour {
    6.  
    7.     public UnityEngine.UI.Slider slider;
    8.     public GameObject x1;
    9.     public GameObject x2;
    10.     public float holdTime = 3f;
    11.  
    12.     // Use this for initialization
    13.     void Start () {
    14.         slider.value = 100;
    15.         x1.gameObject.SetActive(true);
    16.         x2.gameObject.SetActive(false);
    17.     }
    18.    
    19.     // Update is called once per frame
    20.     void Update () {
    21.         if (Input.GetKeyDown("Fire1"))  {
    22.             if (holdTime > 0) {
    23.                 holdTime -= Time.deltaTime;
    24.                 slider.value = holdTime;
    25.                 x1.gameObject.SetActive(false);
    26.                 x2.gameObject.SetActive(true);
    27.  
    28.             }
    29.         }
    30.     }
    31. }
    i want, press fire button then time later object will deactive & that timer on slider UI come 100 to 0
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    I think maybe you're looking for something like this:

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4.  
    5. public class Timer : MonoBehaviour
    6. {
    7.  
    8.     public UnityEngine.UI.Slider slider;
    9.     public GameObject x1;
    10.     public GameObject x2;
    11.     public float holdTime = 3f;
    12.  
    13.     //--- ADD: ---
    14.     public string inputButtonName = "Fire1";
    15.     private bool isHolding;
    16.     private float timeRemaining;
    17.  
    18.     // Use this for initialization
    19.     void Start()
    20.     {
    21.         slider.value = 1; // CHANGE/ADD. Set Slider MAX to 1, not 100.
    22.         timeRemaining = holdTime;
    23.         x1.SetActive(true);
    24.         x2.SetActive(false);
    25.     }
    26.  
    27.     // Update is called once per frame
    28.     void Update()
    29.     {
    30.         //--- CHANGE: ---
    31.         if (Input.GetButton(inputButtonName) && x1.activeSelf) // Button is held down & x1 active.
    32.         {
    33.             if (!isHolding) // Just started holding down; setup timeRemaining.
    34.             {
    35.                 isHolding = true;
    36.                 timeRemaining = holdTime;
    37.             }
    38.             else // Still holding; decrement timeRemaining.
    39.             {
    40.                 timeRemaining -= Time.deltaTime;
    41.                 if (timeRemaining <= 0)
    42.                 {
    43.                     x1.SetActive(false);
    44.                     x2.SetActive(true);
    45.                 }
    46.             }
    47.         }
    48.         else if (timeRemaining < holdTime) // Button is NOT held; increment timeRemaining.
    49.         {
    50.             timeRemaining = Mathf.Clamp(timeRemaining + Time.deltaTime, 0, holdTime);
    51.             if (timeRemaining >= holdTime)
    52.             {
    53.                 x1.gameObject.SetActive(true);
    54.                 x2.gameObject.SetActive(false);
    55.             }
    56.         }
    57.         slider.value = Mathf.Clamp01(timeRemaining / holdTime);
    58.     }
    59. }
     
    polash likes this.
  27. arnesso

    arnesso

    Joined:
    Mar 3, 2015
    Posts:
    93
    Hi,
    I would ask about the FPS arms change , is there any tutorial how to change arms ( kind of fast) ?
    Another question, has anyone tried to make Sliding in RFPS ? similiar to UFPS acparkour or Farcry3
    ?
    Thanks :)
     
  28. polash

    polash

    Joined:
    Jul 8, 2015
    Posts:
    46
    Thanks a lot, It works very nice . Just for learning in line 33 & 35, why is this
    1. if (!isHolding) // Just started holding down; setup timeRemaining.
    2. {
    3. isHolding = true;
     
  29. polash

    polash

    Joined:
    Jul 8, 2015
    Posts:
    46
    There are many tutorials on youtube you can find !
    **(Video not make by me found on youtube)**
    here is one :
     
  30. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Anyone have ideas on the blood particle problem I'm having? Really like to get that Half Life 1 gore going :D
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    It tracks the state that the script is in. If isHolding is true, this means the player is holding down the button. This helps differentiate from the first frame in which Input.GetButton() is true.
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    How did you hook it up? Some of the effects on WeaponEffects use a single instance and just move the instance around. If this is what's happening in your case, you may need to spawn the effect differently.
     
  33. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    How would I spawn it differently though? Were you able to see the gif by chance? (the blood particle will respawn on the ground every time I shoot an npc).
     
  34. EvilGremlin

    EvilGremlin

    Joined:
    Aug 12, 2016
    Posts:
    213
    I can't answer your question but the guys from RFPS are updating to the new particle system. If you can hold out, I would just wait for that. The old particle system seems fairly limited.
     
  35. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Any ideas when that update will be posted? Dyyyyying to get that blood :p
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    Since WeaponEffects uses a single particle effect and moves it to the point of the last hit, in this version of RFPS you'll have to use something like this script on the enemy:

    SpawnAtDamage.cs
    Code (csharp):
    1. using UnityEngine;
    2.  
    3. public class SpawnAtDamage : MonoBehaviour
    4. {
    5.     public GameObject prefab;
    6.  
    7.     private WeaponEffects m_weaponEffects;
    8.     private CharacterDamage m_characterDamage;
    9.     private float m_lastHitPoints;
    10.  
    11.     void Start()
    12.     {
    13.         m_weaponEffects = FindObjectOfType<WeaponEffects>();
    14.         m_characterDamage = GetComponent<CharacterDamage>();
    15.         m_lastHitPoints = m_characterDamage.hitPoints;
    16.     }
    17.  
    18.     void Update()
    19.     {
    20.         if (m_characterDamage.hitPoints < m_lastHitPoints)
    21.         {
    22.             m_lastHitPoints = m_characterDamage.hitPoints;
    23.             Instantiate(prefab, m_weaponEffects.fleshImpact.transform.position, Quaternion.identity);
    24.         }
    25.     }
    26. }
    Assign the blood effect prefab to the Prefab field. Then add this script to the prefab:

    TimedDestroy.cs
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class TimedDestroy : MonoBehaviour
    5. {
    6.     public float duration = 5;
    7.  
    8.     IEnumerator Start()
    9.     {
    10.         yield return new WaitForSeconds(duration);
    11.         Destroy(gameObject);
    12.     }
    13. }
    Here's an example scene:

    BloodSpawn.unitypackage
     
  37. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    226
    Oculus SDK/ GearVR and the RFPS.

    So has anyone gotten the prefab to work with Rift or GearVR? I am working on a gearVR project using RFPS and am having a BUGGER of a time with the control schema. (I'm using a pS4 bluetooth controller clone) Everything works great out of the box (game, RFPS and the oculus SDK with bluetooth game controller inside Unity on the PC) but once I build out to the phone (samsung s7) the control schema breaks completely in VR. (all the controls on the BT controller seem to randomly remap) I'm not sure what the issue is. I'm a fairly C# noob so I am having a bugger of a time tracking it down in the scripts. I'm just wondering if anyone else has seen this issue and or can point me to any info. Thanks all!
     
  38. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    Kk, thank you so much =)
     
  39. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    558
    I have a question about AI. So i built a few walls in a scene and have a door with a script attached that will destroy if damaged, i've set in AI.cs the layer, and added to NPCAttack the raycast hit bit.
    But the AI wont attack the door/wall.

    In AI.cs it has a bool to say if the target is visible and when my player is inside the wall compound the AI visible bool is set to false, I'm wondering how I can set so if they can't see the player then there's gonna be something in the way, and if that something happens to be on the layer the AI can attack then the target should be the closest wall/obstacle it near, then if it can see the player again the hunt the player, but if not then the target should be the next closest obstacle.

    If anyone has any ideas or has tackled this problem please share :D or maybe i've missed something I need to do.

    Thanx Jim
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    My first thought was to set the wall up as a BreakableObject. But the AI component will only target the player or other AIs. So here's how I set it up:
    1. Set the wall's Layer to NPCs.
    2. Add an Animation component with these animation clip names: idle, run, shoot, walk. I just copied a real NPC's Animation component.
    3. Add a NavMesh Agent.
    4. Add an AI component. Make sure Faction is 1 (friendly to player). Set Shoot Range, Attack Range, and Listen Range to 0.
    5. Add a Character Damage component. Set the Dead Replacement and tick Remove Body.
    Or use a dedicated AI product like Behavior Designer or Tactical Shooter AI. :)
     
    llJIMBOBll likes this.
  41. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    558
    Awsome, Thank you Very Much! I never thought about that. :D

    I do have Behaviour Designer and Tactical Shooter AI but need to learn how to use them :D
     
  42. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    476
    Is behaviour designer wasy to learn and is it powerful.
    I have watched behaviour designer tutorials and it seems to be complicated.
    Is there any AI soln which is powerful and easier to use. I tried RAIN and found it way too complex
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,786
    For a behavior tree product, Behavior Designer is easy to learn and use (and has great support). It'll help to know how behavior trees work first. Here's a good intro article. RFPS's built-in AI and Tactical Shooter AI are easy because you can drop them in and use them right away. But you're also locked into the functionality they provide. If that meets your needs, great. With Behavior Designer, on the other hand, you have to do some work up front to design the behavior tree, but you can make your AI do anything.
     
  44. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    186
  45. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    476
    I know how behaviour tree works. But i have tried RAIN which is similar and found it very hard bec of lack of tutorials.
    I have checked behaviour designer and even that doesnt have any deep tutorials.
    I chekced apex AI which seems to have good tutorials but it doesnt seem to work with windows 8
    If i buy something i need to make sure i can figure out most of stuff my own rather than wait for a response from author
     
  46. Locky

    Locky

    Joined:
    May 14, 2015
    Posts:
    86
    Bow and arrow question (love it by the way)
    Can the bow and arrow have a default state that includes an arrow (instead of running around empty?)

    Thanks.
     
  47. egem2015

    egem2015

    Joined:
    Oct 27, 2015
    Posts:
    45
    Hi

    i bought your asset 4 months ago. i have never used it.

    I tried to create a new scene following your doc.

    i put fps main and npc zombie prefab.But npc zombie does not follow player.even it doesnt move.i selected even follow player checkbox.

    1) what could the problem be?

    2) how can i create zombie or robot wave?

    i am using control freak plugin.

    thanks in advance.
     
  48. thenamesace

    thenamesace

    Joined:
    Jan 25, 2014
    Posts:
    157
    You need to bake navmesh in the scene
     
  49. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    196
    Hi All,

    Am I missing something obvious in trying to add a new AI Character enemy in V1.23? I have added a character of my own previously (V1.22) albeit with much difficulty and got it working a while ago in this version - now I cant get a new character to work/function. I follow what I had done previously setting up the character as one the one made in the earlier version which works but I just cant get a new character to "Activate" its animations. I can only get the Character to move with the first animation only playing and shoot a weapon by leaving the AI object with animations field blank or I can get the character to move (mesh) but not play any animation at all nor shoot weapon by dragging the object with animation to the correct field. Either way only the first animation will play at best. Seems like the Character is not instantiated? or such like.

    Not sure if any of that makes any sense?

    Is there something different I have to do in the V1.23 Version as opposed to the V1.22 version?

    Thanks for any help.
     
  50. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    558
    On the ragdoll bones there's a new damage script you might need to attach to your new character's, look at the prefab ai that comes with rfps, you can copy to your ai and drag the new Ai to the slot on the new script (your see what I mean :D).