Search Unity

Realistic FPS Prefab [RELEASED]

Discussion in 'Assets and Asset Store' started by Deleted User, Apr 5, 2013.

  1. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    I don't think anyone really tried that
     
  2. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    I would pay handsomely for this. Maybe someone wanna make an asset for store?
     
    DecayGame likes this.
  3. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    yeah I would buy. to :) someone please make this !:)
     
  4. Amy_Lee87

    Amy_Lee87

    Joined:
    Sep 29, 2016
    Posts:
    8
    I've done tutorials and was able to change the model with Unity's 3rdPersonController. However, I can't get it to work with RFPSP.

    I'll pay someone $20 to make a quick video on how to do it.

    At the moment, my character is stuck in T-pose and will not animate. I'm clearly doing something wrong.
     
  5. EvilGremlin

    EvilGremlin

    Joined:
    Aug 12, 2016
    Posts:
    231
    I just made a quick rfpsp playlist on youtube. I didn't find one about character replacement. I will try to replace one this weekend and let you know. I did find a tutorial for replacing the zombie NPC. That may be a place to start.

     
  6. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    hi,
    I would like to know if anybody has implement a wander behaviour in RFPS without waypoints.I am trying to make a bear wander in the scene randomly (may be inside an area or all the scene) and if detects the player attack him.
    The same for a flee behaviour.
    Any help or idea would be nice

    Thank you to all

    Carlos
     
  7. Dionysos1111

    Dionysos1111

    Joined:
    Feb 14, 2016
    Posts:
    39
    HI,

    I got a weird error when i check the box "Hunt Player" on the AI script:

    UnassignedReferenceException: The variable capsule of FPSRigidBodyWalker has not been assigned.
    You probably need to assign the capsule variable of the FPSRigidBodyWalker script in the inspector.
    AI.SpawnNPC () (at Assets/RFPSP/Scripts/AI/AI.cs:385)
    AI.OnEnable () (at Assets/RFPSP/Scripts/AI/AI.cs:350)

    I'm using Unity 5.4.1

    When i start the game unchecked and check the box in play mode it does work without any errors, very strange.

    I tried a whole new scene with just RFPS in it and still the problem occurs.

    Anyone has any ideas?
     
  8. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    I've finally figure out the core of the problem. Basically I've locked my mouse from Playmaker and from RFPS code and this caused this issue. To fix it, I've just commented RFPS code and now I control mouse only from Playmaker. Too bad it took me 1.5 yrs to solve it. :( But, better late than never.
     
  9. Seriously

    Seriously

    Joined:
    Jun 15, 2013
    Posts:
    9
    Here's a simple one I use. You have to tweak the values in the component and in the NVA until you get the behavior you want. Use low values for the DistanceMultiplier to keep the object in a tight area and to keep Path values valid.

    Code (csharp):
    1.  
    2. // Wander AI for NAVMESHAGENT
    3. // (C) 2016 Dave N Goodman
    4. // david.n.goodman@gmail.com
    5.  
    6. using UnityEngine;
    7. using System.Collections;
    8.  
    9. public class Wander_DNG : MonoBehaviour {
    10.  
    11.     private NavMeshPath Path;
    12.     public float WanderTime = 5.0f;
    13.     public int DistanceMultiplier = 5;
    14.     public Vector3 TargetDestination;
    15.     public bool Wander = true;
    16.     private NavMeshAgent Agent;
    17.     public float _Timer;
    18.  
    19.    
    20.     // Initialize
    21.     void Start ()
    22.     {
    23.         // Grab the NAVMESHAGENT
    24.         Agent = GetComponent<NavMeshAgent>();
    25.        
    26.         // Get the Initial Destination. Use the transform's current position + a random value to get the relative position and add the multiplier for distance.
    27.         TargetDestination = new Vector3(transform.position.x + (Random.value * DistanceMultiplier), 0.0f, transform.position.z + (Random.value * DistanceMultiplier));
    28.        
    29.         // Apply the Initial Destination
    30.         Agent.SetDestination(TargetDestination);
    31.        
    32.         // Set the timer to the Wander Time value
    33.         _Timer = WanderTime;
    34.  
    35.     }
    36.  
    37.     void Update()
    38.     {
    39.        // If WANDER behavior is wanted
    40.         if (Wander)
    41.         {
    42.             DoWander();
    43.         }
    44.      
    45.     }
    46.  
    47.  
    48.     private void DoWander()
    49.     {
    50.         // Update the timer (decrease) by the deltaTime value
    51.         _Timer -= Time.deltaTime;
    52.        
    53.         // When the timer reaches 0 or less, Change the Target Destination and Set to the new Destination
    54.         if (_Timer <= 0)
    55.         {
    56.             // Get the Initial Destination. Use the transform's current position + a random value to get the relative position and add the multiplier for distance.
    57.             TargetDestination = new Vector3(transform.position.x + (Random.value * DistanceMultiplier), 0.0f, transform.position.z + (Random.value * DistanceMultiplier));
    58.  
    59.             // Apply the Updated Destination
    60.             Agent.SetDestination(TargetDestination);
    61.            
    62.             // Reset the Timer to the Wander Time value
    63.             _Timer = WanderTime;
    64.            
    65.         }
    66.  
    67.     }
    68. }
    69.  
     
  10. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    Thank you seriously,

    I have attached your script to the zombie prefab but only works unchecking the AI component and this component can´t be unchecked, anyway it is a good start point.
     
    Seriously likes this.
  11. Seriously

    Seriously

    Joined:
    Jun 15, 2013
    Posts:
    9
    You're welcome. I figured you'd just use it as a starting point. Hope it helps.
     
  12. pinsrq

    pinsrq

    Joined:
    Jan 28, 2016
    Posts:
    2
    i already have this asset and i would wish me 4 thinks: Better enemie AI with hide points, crouching and random actions.
    2: Supporting Particle Systems not Particle emitters. 3. Optionally using Particle Systems as muzzle Flashes.
    And 4: Bullet travel time!

    Thank you very much, Have a nice Day :)
     
  13. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
  14. arnesso

    arnesso

    Joined:
    Mar 3, 2015
    Posts:
    96
    Has anybody ever made project or game RFPS+ photon multiplayer stuff ? I would be interested how can this work with PHOTON.
    Thanks
    Cheers ! :)
     
    DecayGame likes this.
  15. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    Hello everyone!

    I am currently paying someone $75 to get Photon working with Realistic FPS Prefab

    If you guys send me a donation I will release the link to everyone

    My Pay-Pal is paypal.me/adamodambrosio

    I will let you guys know when I hit $75.

    Help me out guys so this can be possible for all of us!
    Cheers!
     
    Last edited: Oct 10, 2016
  16. arnesso

    arnesso

    Joined:
    Mar 3, 2015
    Posts:
    96
    My player is spawning with Photon, but i have still these problems : I cannot pick up weapons, or order NPC, my FPS arms looks real weird, And some NPC do not work, move, but Zombies spawns well, I can kill them but they can cause damage to me.
    I hope someone can figure out , or the 75 $ will be hit.

    RFPS on someway would be better in Multi, than UFPS .( With an mecanim,animator system also would be better I think)
    Peace :)
     
    DecayGame likes this.
  17. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    Agreed.
    Guys help me out so this can be possible! :)
     
    arnesso likes this.
  18. Deleted User

    Deleted User

    Guest

    Hey everyone, sorry for my absence from the forum lately, but just wanted to check in and give you an update on the next version of the Realistic FPS Prefab.

    Thanks for bringing this up, it's definitely a bug that got through testing and will be fixed in the next version. To fix it in the meantime, you can move this initialization code from the Start() method of FPSRigidBodyWalker.cs and put it in the OnEnable() method like this:

    Code (CSharp):
    1.     void OnEnable(){
    2.         //Initialize rigidbody
    3.         RigidbodyComponent = GetComponent<Rigidbody>();
    4.         RigidbodyComponent.freezeRotation = true;//freeze rotation to prevent player sliding down slopes
    5.         RigidbodyComponent.useGravity = true;
    6.         capsule = GetComponent<CapsuleCollider>();
    7.         leanCol = leanObj.GetComponent<CapsuleCollider>();
    8.         sphereCol = GetComponent<SphereCollider>();
    9.     }
    The bug happens because Start() is executed at a different time than OnEnable(), and there is a moment where the AI.cs script can't find the references .

    Also, if you are running the Unity 5.5 beta and encountering errors with AI.cs, you can change the:

    Code (CSharp):
    1. return false;
    statements to:

    Code (CSharp):
    1. yield break:
    There are about 4 lines in AI.cs that need to be updated this way. The return false statements were from some previous methods that were changed in AI.cs.

    As for development of the Realistic FPS Prefab, a new update is nearing completion which will fix a few bugs, add weapon model movement improvements, and convert all legacy particles to Shuriken particle systems. Development will be picking up again, and the main priority is finishing the third person mode and converting the legacy character animations to Mecanim. Using this great feature of Mecanim (humanoid animation retargeting), changing character models should be very simple and quick. Thanks for your patience and support!
     
    Last edited by a moderator: Oct 13, 2016
  19. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Hey guys, just learning the pack here - how do I make it so when I shoot a wood crate, it emits the wood debris particle, or any other surface?

    Cheers!
     
    Last edited: Oct 14, 2016
  20. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Tag the Object with a Collider with Tag "Wood" or for metal sparks tag it "Metal"... If you look at Weapon Effects you can see how it works and also easily add your own :D

    Good Luck RFPS is amazing
     
  21. Yodarkana

    Yodarkana

    Joined:
    Oct 15, 2016
    Posts:
    4
    Hey guys ! so I have a problem. I'm fairly new to making games and this package has really helped me. However there is one thing that isn't quite working and it's the part I was most looking forward too. Whenever I drag an NPC into my scene e.g. Zombie, Robot, Badsoldier. They all just stand there and do nothing at all ! can someone please explain to me how I can get them to target the player and hunt him and stuff instead of just standing there being completely useless.

    Thanks
     
  22. fcwedd

    fcwedd

    Joined:
    Mar 5, 2016
    Posts:
    2
    You need to bake Navigation into your terrain.

    To do this, go to Window / Navigation via Unity's top menu bar. When the Navigation tab is open, the Object Tab should automatically be selected. Select your terrain from the hierarchy. After you select your terrain, click on the Bake tab via Navigation Window. You should then notice a little box on the bottom right of your screen (if in default layout) that says Bake. Click Bake and wait for the process to finish.

    Your NPCs should now interact with your character.
     
  23. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    Has anyone found an Inventory System that really works with this asset? I'm using S-Inventory with Dialog System but it doesn't feel that smooth, like it doesn't flow well. Just want to know what other people have used or recommend.

    As long as the integration is easy to follow i wouldn't mine trying it out.

    I'm going for something more of the fallout system but on the battlefield scenery.
    I just want to be able to save health packs and stuff like that for later use.

    Thanks in advance
     
    Last edited: Oct 16, 2016
  24. EvilGremlin

    EvilGremlin

    Joined:
    Aug 12, 2016
    Posts:
    231
    You can easily use Inventory Pro. Adapting the UFPS installation instructions to RFPS is not too hard.
     
  25. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hormic likes this.
  26. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
  27. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    you prob just need to change to using devdog.Inventorypro; and maybe some other related code... i've not tested with new version as i'm using old in my project... shoudn't be too hard to adapt :D
     
  28. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    Guys if you don't send a small donation I can't get the multiplayer for us . . :( please send asap if you are interested because I don't got a lot of money atm to pay for this . . I only got $40 on my paypal atm and for you people reading this for the first time this the information :)
    I am currently paying someone $75 to get Photon working with Realistic FPS Prefab
    If you guys send me a donation I will release the link to everyone
    My Pay-Pal is paypal.me/adamodambrosio
    Help out guys so this can be possible for all of us!
    if you have any question feel free to add me on skype - adamo.dambrosio2
     
    Last edited: Oct 16, 2016
    dudespeaks and emperor12321 like this.
  29. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Hey guys, I'm trying to hook up the Propulsion Physics pack which is essentially a jump pad https://www.assetstore.unity3d.com/en/#!/content/7092
    but when using RFPS I only jump up a little, anyone have any tips where to look on how to make this work? I've provided a video of the result on my end.
     
  30. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    Quick question, how do you disable auto equip weapons on pick up? is there a bool somewhere or do i have to hard code it?

    Also iv removed the key for 3rd person in the input, is there a bool for that too? i could of swear there was one.
     
  31. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    For the weapon pickup, open weapon pickup.cs and line 137 comment out
    Code (CSharp):
    1. //select the weapon after picking it up
    2.             PlayerWeaponsComponent.StartCoroutine(PlayerWeaponsComponent.SelectWeapon(WeaponBehaviorComponent.weaponNumber));
    3.            
    and the 3rd person option is on main camera, camera control script there's a bool to enable disable :D
     
    JACKO4590 likes this.
  32. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    59
    Hey TonyLi this is what i have been working on and what you have helped me with but may i ask how to pick up health on trigger and how to disable something after some time but not disable it forever so it can be triggered again because my status effects (at about 4:30 in the video) disable and dont come back when i try to trigger them. Thanks for everything.
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Reminds me of a cross between Doom and Serious Sam!

    By "pick up health on trigger" do you mean walking over it (i.e., entering its trigger collider)? If so, the short script in this post should do it. Make sure your health is also set up for regular RFPS-style interaction.

    You can use the C# script below (TimedEvent) to time things. Here's the basic idea of how to use it:

    1. Create an empty GameObject. Put the TimedEvent script on it. Make the effect GameObject a child of this empty GameObject.

    2. Set the Duration to the number of seconds when it should come back.

    3. In the OnTimeReached() section, click "+" to add a new slot. Assign your status effect GameObject. Then from the dropdown select GameObject > SetActive if your effect disables itself by deactivating the GameObject, or the script name > enabled if the effect disables itself by disabling the script. Either way, tick the checkbox.

    4. When you trigger the effect, call the TimedEvent script's StartTimer method.

    The process might be slightly different depending on how you've set up your status effects. There's also an activateOnEnable checkbox that you can play with to start the timer automatically when the script is enabled.

    Script: TimedEvent
    Code (csharp):
    1. using UnityEngine;
    2. using UnityEngine.Events;
    3.  
    4. public class TimedEvent : MonoBehaviour
    5. {
    6.     public float duration = 0;
    7.     public bool activateOnEnable = false;
    8.  
    9.     public UnityEvent onTimeReached = new UnityEvent();
    10.  
    11.     private void OnEnable()
    12.     {
    13.         if (activateOnEnable) StartTimer(duration);
    14.     }
    15.  
    16.     private void OnDisable()
    17.     {
    18.         CancelTimer();
    19.     }
    20.  
    21.     public void StartTimer()
    22.     {
    23.         StartTimer(duration);
    24.     }
    25.  
    26.     public void CancelTimer()
    27.     {
    28.         CancelInvoke("TimeReached");
    29.     }
    30.  
    31.     private void TimeReached()
    32.     {
    33.         onTimeReached.Invoke();
    34.     }
    35. }
     
  34. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    Thank you, yes i found the 3rd person script, it was minimized on mine so thats why I over looked it.
    And thank you for the help on the auto equip. Im using s-inventory system atm to pick up weapons so i just matched the code and blanked it out.

    Another problem, when dropping items from the inventory. If i have something equip it doesn't un-equip it but instead it holst's it. I then have to un equip it from the equipment panel then re equip it. Is there a way to stop this from happening?
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Are you using the Dialogue System's S-Inventory + RFPS integration package? If so, I'll take a look into this and change the behavior if necessary.
     
  36. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    Yeah I am Tony. Not sure what's doing it but Iv set it up that you can't scroll to select weapon so you have to open inventory > unequip > re equip weapon.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    I'm not sure if the S-Inventory API changed or if that was a straight-up bug, but either way it needed fixing. You can download the fix on the Dialogue System Extras page or here:

    RFPS_SInventory_Support_2016-10-19.unitypackage

    It's a one character fix, so if you'd like to apply the fix to your copy of the script instead of downloading and importing the package, on line 101 of FPSInventoryEvents.cs change the "0" to a "1":

    Code (csharp):
    1. if (SInventoryLua.GetItemAmount(name, item.Name) > 0) //<-- CHANGE to 1.
     
    JACKO4590 likes this.
  38. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    Thanks mate. When I get home I'll apply this. I'm pretty much up to level setting up now. I'm hoping to share some of my work soon once I have something worth watching.

    Thank you all for your help.

    EDIT: sorry just got home, I changed the code but seems to be still doing it.
    EDIT2: ok i just tried to drop a medkit and it didn't holst my weapon, while dropping a handgun it dose. Ill do a bit more digging around
     
    Last edited: Oct 20, 2016
  39. Dionysos1111

    Dionysos1111

    Joined:
    Feb 14, 2016
    Posts:
    39
    Hey guys,

    I am trying to change the behavior of the ai, i want the zombies to target the FPSPlayer at all times but when a goodsoldier gets in a range of 30 it need to attack the goodsoldier, also when the FPSPlayer and the goodsoldier are both in range of 30 it needs to attack the FPSPlayer.

    I already changed the attack range to 2048 and set the targetVisible to false so that the zombies will target the nearest player or goodsoldier but when the zombies have a target they won't switch to another target unless it's dead.

    Any help on this is greatly appreciated.
     
  40. dudespeaks

    dudespeaks

    Joined:
    Jul 23, 2016
    Posts:
    2
    Sounds awesome Decay. No guarantees, but I'll try to send you a few bucks on meh next pay day Wed 10-26.
     
  41. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    477
    I have some game levels where I would like to be able to move the player around using elevators, platforms and also have an enter-able drop ship (back end) that I would like the player to get in to move him to a locations....I have a lot of High areas like platforms atop very high buildings and tops of skyscrapers the player needs to get to....

    Looking at the elevator/platform system I can use these of course however by default there is little control of the elevator/platform objects.....they constantly move back and forth in both directions back and forth either only horizontally or vertically and don't stop (wait-period) for the player to step easily onto them, particularly in this instance as an elevator say moving a great height takes ages to cover the distance so needs to move fairly fast then not allowing the player to get on and off in time...

    Does anyone know how best I might achieve what I need to do which is have the moving object that the player gets onto "stop or wait" at the movement end point(s) for a specified wait period so the player has plenty of time to get on and off before it moves again? I also would like iif possible to have the moving object move to more than one location i.e. move to multiple points (similar to moving along a path with multiple points) in both horizontal and vertical directions?....

    I have looked at the Elevator and Platform Scripts and can see I might be able to perhaps adjust/edit/combine parts of these if I could get them to work (probably not) but as I am new to Unity scripting I would not know how to get the moving objects to stop or wait at any end points? I don't need the Player to fly anything just to have the object he stands on or gets into move him around in both vertical and horizontal directions and wait at the points a little time if possible....Perhaps a trigger might work to activate the moving object only when/while the player is in collision with it?

    Perhaps someone has already done something similar and any help would be much appreciated.

    Thanks very much.

    Peter
     
  42. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Does anyone know how to shoot grenades or projectile based bullets from the guns as primary fire? Im wondering if theres a way to set up a secondary fire mode as well, like burst fire, attached grenade launcher, etc.?
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    For primary fire, try using the same thing as the bow & arrow. Here are instructions for explosive arrows. Rockets aren't much different.

    Maybe Azuline can put secondary fire modes in the next version of RFPS.
     
    RangePlusOne likes this.
  44. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    Thanks! But one question remains, how does the bow know to shoot the arrow, where is the prefab assigned?
     
  45. 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.
     
  46. Dionysos1111

    Dionysos1111

    Joined:
    Feb 14, 2016
    Posts:
    39

    Anyone??
     
  47. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    @Dionysos1111 maybe a different AI? try behavior designer or tactical shooter AI. their AI is more polished and also have integration for RFPS.
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    I don't know if this is documented or it. It seems kind of obscure. I had to skim over the code to find it the first time.

    There's a child of FPS Main called Object Pooling Manager. Add your projectile to Object Pooling Manager's Obj Registry list and note its index (e.g., 18).

    Then on your weapon's Weapon Behavior script, under the Damage and Firing heading, find Projectile Pool Index. Set this to the index you noted from the Obj Registry list.
     
    RangePlusOne likes this.
  49. RangePlusOne

    RangePlusOne

    Joined:
    Dec 6, 2014
    Posts:
    123
    You're awesome! Thanks so f***ing much for your help, seriously. That was exactly what I needed to know. Salute! S!
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,694
    Glad to help!