Search Unity

Realistic FPS Prefab [RELEASED]

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

  1. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    I don't like that when I zoom with AK. Mouse sensitivity doesn't change. I would love if you would also replace old gui with new Unity GUI. I would also love to see better ladder system.
     
    Last edited: Apr 17, 2015
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    @Azuline Studios - Using the new Unity UI would be great! Skim back a few pages for user-contributed examples, including putting world space canvases on weapons themselves for ammo readouts.
     
  3. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    @Azuline Studios thanks for updates!
    Time to Bug report! :D Death on collision not working :l
    RFPS Glitch.png
     
  4. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    I can't use behavior designer. When the AI spawns the behavior tree is disabled. I have talked to the dev about this issue and he said he is going to try and fix it in future updates! Any other way? Maybe making a modification to the AI script that it already has attached it it.
     
  5. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Did I talk to you through email or the opsive forum? The only issue that I remember is this one but that was unrelated. Send me an email (support@opsive.com) and I'll be able to help - there shouldn't be a reason why you can't have the behavior tree enabled when the agent spawns.
     
  6. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Can't wait for this new update! Thank you Azuline Studios for pushing through and kept the asset alive! I just tried the web demo and it is perfect. So much more action is happening with the NPC's attacking each other. Now if there was multiplayer support for this asset! It would be the best FPS Asset you can buy on the store!

    Thanks again and keep up the fantastic work!
     
  7. littlewinch

    littlewinch

    Joined:
    Oct 12, 2013
    Posts:
    7
    OK Thanks!
     
  8. littlewinch

    littlewinch

    Joined:
    Oct 12, 2013
    Posts:
    7
    How would you add multiple targets for NPCs? I would like them to continue fighting after I die, but how would I configure this? Thanks!
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Here's a way to do it:

    1. I went with a world space canvas on each pickup. If you're using prefabs, you only need to set it up on the prefab, and then you can place as many as you want in your scene. Since only one pickup canvas will be active at a time, there's really no performance issue.





    2. I added the Dialogue System's example "Always Face Camera" script to the canvas (Pickup Canvas). Here's a free copy (AlwaysFaceCamera.cs):
    Code (csharp):
    1. using UnityEngine;
    2.  
    3. namespace PixelCrushers.DialogueSystem.Examples {
    4.  
    5.     /// <summary>
    6.     /// Component that keeps its game object always facing the main camera.
    7.     /// </summary>
    8.     [AddComponentMenu("Dialogue System/Actor/Always Face Camera")]
    9.     public class AlwaysFaceCamera : MonoBehaviour {
    10.      
    11.         public bool yAxisOnly = false;
    12.      
    13.         private Transform myTransform = null;
    14.      
    15.         void Awake() {
    16.             myTransform = transform;
    17.         }
    18.  
    19.         void Update() {
    20.             if ((myTransform != null) && (UnityEngine.Camera.main != null)) {
    21.                 if (yAxisOnly) {
    22.                     myTransform.LookAt(new Vector3(UnityEngine.Camera.main.transform.position.x, myTransform.position.y, UnityEngine.Camera.main.transform.position.z));
    23.                 } else {
    24.                     myTransform.LookAt(UnityEngine.Camera.main.transform);
    25.                 }
    26.             }
    27.         }
    28.      
    29.     }
    30.  
    31. }
    3. Create a script named PickupUI.cs and add it to the main pickup object. This script hides the canvas when the scene starts, and provides methods to show and hide during gameplay.
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PickupUI : MonoBehaviour {
    5.  
    6.     public Canvas canvas = null;
    7.  
    8.     private bool isShowing = false;
    9.  
    10.     void Awake() {
    11.         if (canvas == null) canvas = GetComponentInChildren<Canvas>();
    12.         if (canvas == null) {
    13.             Debug.LogError("No Unity UI canvas found under " + name);
    14.             enabled = false;
    15.         } else {
    16.             canvas.gameObject.SetActive(false);
    17.         }
    18.     }
    19.  
    20.     public void Show() {
    21.         canvas.gameObject.SetActive(true);
    22.     }
    23.  
    24.     public void Hide() {
    25.         canvas.gameObject.SetActive(false);
    26.     }
    27.  
    28. }
    4. Edit FPSPlayer.cs. Around line 626 add the following line (I included a couple lines of context from the original script):
    Code (csharp):
    1.             }else{
    2.                 if(crosshairTextureState){
    3.                     UpdateReticle(true);//show aiming reticle crosshair if raycast hits nothing
    4.                 }
    5.             }
    6.  
    7.             //[TL] Add this line below:
    8.             UpdatePickupUI(hit);
    9.  
    10.         }else{
    11.             if(crosshairTextureState){
    12.                 UpdateReticle(true);//show aiming reticle crosshair if reloading, switching weapons, or sprinting
    13.             }
    14.         }
    5. And then add this somewhere in the script (I added it after the FixedUpdate() method):
    Code (csharp):
    1.     PickupUI targetedPickupUI = null; //[TL]
    2.     Collider targetedCollider = null;
    3.  
    4.     void UpdatePickupUI(RaycastHit hit) {
    5.         if (hit.collider == null) {
    6.             if (targetedCollider != null) {
    7.                 if (targetedPickupUI != null) {
    8.                     targetedPickupUI.Hide();
    9.                     targetedPickupUI = null;
    10.                 }
    11.                 targetedCollider = null;
    12.             }
    13.         } else if (hit.collider != targetedCollider) {
    14.             targetedCollider = hit.collider;
    15.             if (targetedPickupUI != null) {
    16.                 targetedPickupUI.Hide();
    17.             }
    18.             targetedPickupUI = targetedCollider.GetComponent<PickupUI>();
    19.             if (targetedPickupUI != null) {
    20.                 targetedPickupUI.Show();
    21.                 UpdateReticle(false);
    22.             }
    23.         }
    24.     }
     
    Black-Spirit likes this.
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    If you have Behavior Designer, you can use the steps in this post. Otherwise you'll have to modify AI.cs.
     
  11. Cherno

    Cherno

    Joined:
    Apr 7, 2013
    Posts:
    515
    Hi, just saw this thread, it might have been asked already: Is there an option to prevent the player from pushing other rigidbodies?
     
  12. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    The New Update for this Asset would really come in handy right about now for my game at the moment! The new AI using the navmesh is just genius. Right now I am working on animal AI using the RFPS AI script and they keep just walking into the terrain trees when they are set on a waypoint to go to! Or even better add a random patrol option so the AI does not need a waypoint it simply just chooses a random place within a certain radius and goes to there! :D
     
  13. ThermodynamicsMakesMeHot

    ThermodynamicsMakesMeHot

    Joined:
    Feb 14, 2015
    Posts:
    224
    ** Driving Car Issue **
    FPSPlayer gets in the car but then slowly moves backwards. (cant move but can use mouselook, can use weapons if wish to enable)
    Car moves only after "jump" or spacebar is pressed, other wise the wheels just turn. The player does not stay in vehicle and moves slowly backwards.

    Ideas?

    In FPS Player.cs
    Code (csharp):
    1.  
    2.   // Vehicle Controls
    3.   private bool _getInCar;
    4.   private bool _getInLowCar;
    5.   private FPSPlayer _charCtrl;
    6.   private int doorSide = 1;
    7.   [HideInInspector] public GameObject carCamPoint;
    8.   [HideInInspector] public GameObject currDoor;
    9.   [HideInInspector] public GameObject currCar;
    10.   [HideInInspector] public bool InCar = false;
    11.  
    12. //Then in pickups colliders
    13.   else if (hit.collider.gameObject.GetComponent<CarControl>())
    14.   {
    15.   pickupTex = pickupReticle;
    16.  
    17.   currCar = hit.transform.gameObject;
    18.   if ( currCar.GetComponent<CarControl>().lowDoors )
    19.   {
    20.   _getInLowCar = true;
    21.   StartCoroutine( GetInCar() );
    22.   }
    23.   else
    24.   {
    25.   _getInCar = true;
    26.   StartCoroutine( GetInCar() );
    27.   }
    28.   }
    29.  
    30. //Function to get in vehicle
    31.   IEnumerator GetInCar ()
    32.   {
    33.   FPSWalkerComponent.inputX = 0; // stop player movement x
    34.   FPSWalkerComponent.inputY = 0; // stop player movement y
    35.   FPSWalkerComponent.Driving = true; // This stops FPSWalker from doing anything on update/fixedupdate
    36.   PlayerWeaponsComponent.enabled = false; // disable weapons
    37.  
    38.   GameObject sitPoint = currCar.transform.Find( "sitPoint" ).gameObject;
    39.   carCamPoint = currCar.transform.Find( "carCamPointA" ).gameObject;
    40.   currCar.GetComponent<CarControl>().openDoor = true;
    41.   this.transform.parent = sitPoint.transform;
    42.   this.transform.position = sitPoint.transform.position;
    43.   this.transform.rotation = sitPoint.transform.rotation;
    44.   yield return new WaitForSeconds( 2.5f );  
    45.  
    46.   currCar.GetComponent<CarControl>().openDoor = false;
    47.   Transform Seat = currCar.transform.Find( "seat" );
    48.   this.transform.parent = Seat.transform;
    49.   this.transform.position = Seat.transform.position;
    50.   this.transform.rotation = Seat.transform.rotation;
    51.   InCar = true;
    52.   }
    53.  
    then the car control
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. //CAR CONTROLL SCRIPT BASED ON  Andrew Gotow's TUTORIAL (http://www.gotow.net/andrew/blog/?page_id=78) KUDOS TO HIM
    5. public class CarControl : MonoBehaviour
    6. {
    7.   private Animator _animator;
    8.  
    9.   public WheelCollider FrontLeftWheel;//front left wheel collider
    10.   public WheelCollider FrontRightWheel;//front right wheel collider
    11.  
    12.   public bool openDoor = false;
    13.   public bool engineStopped;
    14.   public bool lowDoors;
    15.   // These variables are for the gears, the array is the list of ratios. The script
    16.   // uses the defined gear ratios to determine how much torque to apply to the wheels.
    17.   public float[] GearRatio;//array of gear ratios
    18.   public ParticleSystem[] fumes;
    19.   public int CurrentGear = 0;//our current gear
    20.   public int minEmission;
    21.   public int maxEmission;
    22.   public float EngineTorque = 600f;
    23.   public float MaxEngineRPM = 1000f;//maximum rotation per minute
    24.   public float MinEngineRPM = 500f;//minimum rotation per minute
    25.   public float zRotation = 3f;//speed of steering whell rotation
    26.   public float centerOfMassY;
    27.  
    28.   public AudioClip engineStart;
    29.   public AudioClip engineIdle;
    30.   public AudioClip engineStop;
    31.  
    32.   public float EngineRPM = 0f;//starting rotation per minute
    33.   private GameObject objPlayer;//Player
    34.   private FPSPlayer CharCtrlScript;
    35.   // Use this for initialization
    36.   void Start ()
    37.   {
    38.   FrontLeftWheel.brakeTorque = 300;
    39.   FrontRightWheel.brakeTorque = 300;
    40.   ///////CACHING VARIABLES
    41.   foreach ( ParticleSystem PS in fumes )
    42.   {
    43.   PS.enableEmission = false;
    44.   PS.emissionRate = minEmission;
    45.   }
    46.   _animator = GetComponent<Animator>();
    47.   objPlayer = (GameObject) GameObject.FindWithTag( "Player" );
    48.   CharCtrlScript = (FPSPlayer) objPlayer.GetComponent( typeof( FPSPlayer ) );
    49.   rigidbody.centerOfMass = new Vector3( rigidbody.centerOfMass.x, centerOfMassY, rigidbody.centerOfMass.z );//changing car's center of mass
    50.   //if using another car's model play with these values to fit Your needs
    51.   }
    52.  
    53.   // Update is called once per frame
    54.   void Update ()
    55.   {
    56.   if ( ( CharCtrlScript.InCar ) && ( CharCtrlScript.currCar == this.gameObject ) )
    57.   {
    58.   if ( !audio.isPlaying )
    59.   {
    60.   StartCoroutine( EngineStart() );
    61.   }
    62.   foreach ( ParticleSystem PS in fumes )
    63.   {
    64.   PS.enableEmission = true;
    65.   }
    66.   if ( Input.GetAxis( "Vertical" ) != 0 )
    67.   {
    68.   foreach ( ParticleSystem PS in fumes )
    69.   {
    70.   PS.emissionRate = Mathf.Lerp( PS.emissionRate, maxEmission, Time.deltaTime * 10 );
    71.   }
    72.  
    73.   }
    74.   else
    75.   {
    76.   foreach ( ParticleSystem PS in fumes )
    77.   {
    78.   PS.emissionRate = Mathf.Lerp( PS.emissionRate, minEmission, Time.deltaTime * 10 );
    79.   }
    80.   }
    81.   //check if we're riding a car, AND a car is actually THIS car
    82.   rigidbody.drag = rigidbody.velocity.magnitude / 50;//lets decrease the drag (http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-drag.html)  
    83.   EngineRPM = ( FrontLeftWheel.rpm + FrontRightWheel.rpm ) / 2;//calculate engine rotation per minute
    84.   //engine Sound control
    85.   audio.pitch = Mathf.Abs( EngineRPM / MaxEngineRPM ) + 1f;//audio source pitch value is calculated basing on rounded division of current
    86.   //rotation per minute and max rotation per minute +1, so this value will never be lesser than 1 (standart pitch value)
    87.   //but will be increased if rotation per minute is increased
    88.   if ( audio.pitch > 2f )
    89.   {//don't make pitch value greater than 2
    90.   audio.pitch = 2f;
    91.   }
    92.   FrontLeftWheel.motorTorque = EngineTorque / GearRatio[ CurrentGear ] * Input.GetAxis( "Vertical" );// multiply the torque on the wheels by the input value
    93.   FrontRightWheel.motorTorque = EngineTorque / GearRatio[ CurrentGear ] * Input.GetAxis( "Vertical" );// multiply the torque on the wheels by the input value
    94.   //wheels' steering angle based on player's input    
    95.   FrontLeftWheel.steerAngle = 25 * Input.GetAxis( "Horizontal" );
    96.   FrontRightWheel.steerAngle = 25 * Input.GetAxis( "Horizontal" );
    97.  
    98.   if ( Input.GetButtonDown( "Jump" ) )
    99.   {//if we press space bar
    100.   //lets stop the car
    101.   FrontLeftWheel.brakeTorque = 300;
    102.   FrontRightWheel.brakeTorque = 300;
    103.   }
    104.   if ( Input.GetButtonUp( "Jump" ) )
    105.   {//if we release space bar
    106.   //lets zero brakeTorque values of the wheels so we can move
    107.   FrontLeftWheel.brakeTorque = 0;
    108.   FrontRightWheel.brakeTorque = 0;
    109.   }
    110.   }
    111.   else
    112.   {
    113.   foreach ( ParticleSystem PS in fumes )
    114.   {
    115.   PS.enableEmission = false;
    116.   }
    117.   }
    118.   if ( engineStopped )
    119.   {
    120.   StartCoroutine( EngineStop() );
    121.   }
    122.   }
    123.   void FixedUpdate ()
    124.   {
    125.   _animator.SetBool( "Open", openDoor );
    126.   }
    127.   IEnumerator EngineStart ()
    128.   {
    129.   engineStopped = false;
    130.   audio.clip = engineStart;
    131.   audio.Play();
    132.   yield return new WaitForSeconds( audio.clip.length - 0.3f );
    133.   audio.clip = engineIdle;
    134.   audio.Play();
    135.   }
    136.   IEnumerator EngineStop ()
    137.   {
    138.   FrontLeftWheel.brakeTorque = 300;
    139.   FrontRightWheel.brakeTorque = 300;
    140.   engineStopped = false;
    141.   audio.clip = engineStop;
    142.   audio.Play();
    143.   yield return new WaitForSeconds( audio.clip.length - 0.3f );
    144.   audio.Stop();
    145.   audio.clip = null;
    146.   }
    147. }
    148.  

    Think I got all the mods I did.

    Basically looking to achieve where the player is placed in the drivers seat.
    Can look around with mouselook, (optional can use weapons).
    But the wsad keys control the car.

    ( I also had to use Tony's input settings for using his dialogue system to use the Horizontals and verticals.)
    ( here is a link to a demo vehicle: http://www63.zippyshare.com/v/8rZAN27I/file.html)
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi,
    What if you set the player's rigidbody.isKinematic=true while the player is in the car? Does this fix it (hopefully without breaking other parts)?
     
  15. ThermodynamicsMakesMeHot

    ThermodynamicsMakesMeHot

    Joined:
    Feb 14, 2015
    Posts:
    224
    Adding:
    Code (csharp):
    1. FPSWalkerComponent.rigidbody.isKinematic = true;
    inside the GetInCar function worked. Thank you for that.
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Lucky guess. :) Remember to set it back to false when the player exits the car.
     
  17. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Hey everyone I am getting a ton of errors in the console that say this
    layer numbers must be between 0 and 31
    UnityEngine.CharacterController:SimpleMove(Vector3)
    <StandWatch>c__Iterator0:MoveNext() (at Assets/!RFPSP/Scripts/AI/AI.cs:166)

    Can anyone help me resolve this issue?
     
  18. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Also I am using unity 5 when this error occurred!
     
  19. ThermodynamicsMakesMeHot

    ThermodynamicsMakesMeHot

    Joined:
    Feb 14, 2015
    Posts:
    224
    This is likely because you are changed the AI movements and it broke. I know I ran into the same thing doing a random patrol option.

    Here's what I did but where there is a lot of guys like 100+ it lags. So there is likely a better way but this works.
    In AI.CS
    Code (csharp):
    1.  
    2. //Random patrol variables
    3.   public bool doRandomPatrol = true; // Should this object do a random patrol
    4.   private float _lastMoveTime = 0.0f; // last time the object moved
    5.   private float _currentWaitTime = 0.0f; // time left before can move again
    6.   public float WaitTimeBeforeMoving = 2.0f; // time has to wait before moving.
    7.  
    Then in IEnumerator StandWatch()

    added right after:
    Code (csharp):
    1.  
    2.   if (CanSeeTarget())
    3.   {
    4.   yield return StartCoroutine(AttackPlayer());
    5.   }
    6.   }
    7.  
    I added
    Code (csharp):
    1.  
    2.   if (doRandomPatrol)
    3.   { // START IF: Should wander around
    4.   if (_lastMoveTime < 3)
    5.   { // START IF: Last time object moved less then move time
    6.  
    7.   yield return StartCoroutine(RandomMove());
    8.   } // END IF: Last time object moved less then move time
    9.   else
    10.   { // START ELSE: Last move time > 3
    11.   if (_currentWaitTime > WaitTimeBeforeMoving)
    12.   { // START IF: Current waiting time > the time enemy needs to wait before moving again.
    13.  
    14.   RandomTurn(); // Randomly turn directions
    15.   yield return StartCoroutine(RandomMove());
    16.  
    17.   } // END IF: Current waiting time > the time enemy needs to wait before moving again
    18.   else
    19.   { // START ELSE: Current waiting time < the time enemy needs to wait before moving again
    20.  
    21.   _currentWaitTime += Time.deltaTime;
    22.   } // END ELSE: Current waiting time < the time enemy needs to wait before moving again
    23.   }// END ELSE: Last move time > 3
    24.   } // END IF: Should wander around
    25.  
    then a couple new methods
    Code (csharp):
    1.  
    2.   public IEnumerator RandomMove ()
    3.   {
    4.   CharacterController controller = GetComponent<CharacterController>();
    5.   Vector3 forward = transform.TransformDirection( Vector3.forward );
    6.   controller.Move( forward * walkSpeed * Time.deltaTime );
    7.   _lastMoveTime += Time.deltaTime;
    8.  
    9.   //For Legacy Animation
    10.   objectWithAnims.animation.CrossFade( walkAnimiationName, 0.2f );
    11.  
    12.   yield return new WaitForFixedUpdate();
    13.   }
    14.  
    15.   void RandomTurn ()
    16.   {
    17.   float dir = Random.Range( 0, 360 );
    18.   transform.eulerAngles = new Vector3( transform.eulerAngles.x, dir, transform.eulerAngles.z );
    19.  
    20.   //For Legacy Animation
    21.   objectWithAnims.animation.CrossFade( walkAnimiationName, 0.2f );
    22.  
    23.   _lastMoveTime = 0.0f; // Reset last move time
    24.   _currentWaitTime = 0.0f; // Reset current wait time
    25.   }
    26.  
     
    Last edited: Apr 21, 2015
    RealAspireGames likes this.
  20. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Nope that did not work! Still get the same error. Also when I play it in the game engine it lags like no other.
     
  21. ThermodynamicsMakesMeHot

    ThermodynamicsMakesMeHot

    Joined:
    Feb 14, 2015
    Posts:
    224
    The objectwithanims....did you copy and paste script values without reassigning this to the object?
     
    RealAspireGames likes this.
  22. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    I have fixed the issue. Turns out it had to do with the behavior designer RFPS scripts conflicting with my custom scripts! But the issue is resolved. Thank you.
     
  23. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    I know Azuline Studios did not give an E.T.A on when the next update will be released. But does anybody have an estimated guess?
     
  24. sluice

    sluice

    Joined:
    Jan 31, 2014
    Posts:
    416
    Don't get your hopes up and don't wait for it is all I can say..
     
  25. Deleted User

    Deleted User

    Guest

    Hasn't been submitted yet CactiiPie, the update itself is finished, currently just making some usability edits, going through the scripts and adding comments/tooltips, and updating the documentation. The nav mesh is really great, so glad that Unity opened up the feature set to indie devs. The NPCs are much more interesting and challenging now :)


    Thanks for the suggestion Gua, in the next version the mouse/joystick sensitivity while zooming can be customized per weapon with a variable called zoomSensitivity of WeaponBehavior.cs. You can try this out with the sniper rifle in the new web player demo. A new GUI will likely be implemented, but not in the upcoming version, since we need to release it soon. By a better ladder system, do you mean one that locks the player to the ladder and only allows them to move vertically when climbing?


    This has been fixed, Takahama. Thanks for pointing this out! The upgrade to Unity 5 reset some trigger and layer settings.


    No problem godofwarfare115, thanks for your your interest and feedback, as they help us improve the asset!


    In the next version, the AI has been almost completely rewritten. There is now an NPC manager which allows the NPCs to target other NPCs, based on their faction alignments, whether or not the player is alive in the scene.


    Hi Cherno, there is not currently an option to prevent the player from pushing rigibodies from the inspector, but if you change this code around line 580 of FPSRigidBodyWalker.cs from this:

    Code (CSharp):
    1. if((!hit2.rigidbody && grounded) || ((airTime + 0.5f) > Time.time)){//allow the player to run into rigidbodies
    to this:

    Code (CSharp):
    1. if((/*!hit2.rigidbody &&*/ grounded) || ((airTime + 0.5f) > Time.time)){//allow the player to run into rigidbodies
    The player should stop before running into a rigidbody, though you still will be able to strafe into them.


    Those are some great modifications ThermodynamicsMakesMeHot, in the upcoming version of the Realistic FPS Prefab, the waypoint system has been rewritten and the waypoint following code has been optimized, so performance of the NPC AI should be better for patrolling NPCs.


    Probably early-mid May, or sooner, since it's just the documentation and comments/tooltips that need to be updated. It may take a while longer if any other issues are found before then, but so far everything is going well.


    Here are the changes for the upcoming version of the Realistic FPS Prefab:
    • Added condition checks to WeaponBehavior.cs to prevent shells from ejecting from weapons by selecting "none" for Shell Prefab RB and Shell Prefab Mesh references in the inspector.
    • Added godMode var to FPSPlayer.cs.
    • Fixed canZoom var of WeaponBehavior.cs to allow /prevent zooming for a weapon.
    • Fixed jump button not moving player up ladders.
    • Added legs in firstperson view and wrote a VisibleBody.cs script.
    • silentShots var of WeaponBehavior.cs can be used to make NPCs not detect certain weapons firing.
    • Fixed logic error in slope check code.
    • Created a replacement of the original PlayClipAtPoint function. Only one instance of this utility script is needed per scene.
    • New player prefab called "FPS Player Main 1 Cam" can be used for 1 camera setups to allow shadows from level geometry to be casted on weapon models and for better compatibility with image effects and shaders.
    • New, experimental tree models using Unity 5's LOD system, TODO: fade shaders between LOD states.
    • Updated certain weapon textures.
    • Udated game assets to use Unity 5's new standard shader, image effects, and water shader.
    • Updated WaterZone.cs and WaterZone prefab to use new Unity 5 water shader.
    • Moved zoomSensitivity var to WeaponBehavior.cs to allow for tuning of zoomed mouse sensitivity per weapon.
    • Improved NPC horizontal tracking of targets. Smoother and more accurate rotation allows them to attack strafing targets much better now.
    • NPC registry, spawner, and wave manager scripts created to track, and dynamically add NPCs to scenes.
    Thanks again for your patience as this update nears completion. Also, here is an updated version of the web player demo with some minor tweaks since the last posting:

     
  26. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    @Azuline Studios, Player can climb up ladder, but he can't climb down. Player is falling when he tries to climb down.
     
    Last edited: Apr 27, 2015
  27. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    122
    @Azuline Studios ,

    Did you get mecanim working for NPCs? I remember it was going to be an upcoming change to the next version.

    Thanks,

    John
     
  28. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    llJIMBOBll and RealAspireGames like this.
  29. reflexct9

    reflexct9

    Joined:
    Apr 13, 2015
    Posts:
    3
    It would be great if u add multiplayer support in the future e.g using Photon Unity Networking
     
  30. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    UFPS went this way. It wasn't a good decision. Cause community spend more than year without significant updates to the package.
     
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    I agree. Multiplayer needs to be in a product's design from the beginning. It would be best to appreciate RFPS as a great single player FPS system, and look elsewhere for multiplayer.
     
    RealAspireGames likes this.
  32. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    I want to use Ui.Text for healthtext. Help me!
    And how to use it mobile control using control freak..?
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    You can use these instructions to use Unity UI for health text. The instructions are for using a slider as a health bar, but you can use a UI.Text instead. http://www.pixelcrushers.com/how-to-use-unity-ui-for-a-health-bar-in-realistic-fps-prefab/

    Follow Control Freak's Quick-Start Guide and Porting Guide. Briefly, set up your Control Freak Controller, then do a global search and replace to change "Input." to "CFInput." in the *.cs files.
     
  34. mentolatux

    mentolatux

    Joined:
    Nov 2, 2014
    Posts:
    240
    help me to change character, i have animation on character
     
  35. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Is there a way to change the hand textures somehow! I just finished with UI and I want to make the hands look a bit more scifi!
     
  36. LAUDSOFT

    LAUDSOFT

    Joined:
    Jan 5, 2014
    Posts:
    102
    Awesome! Thanks for making this update, look forward to using this.
     
  37. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    RFPS Error
    Using Unity 5
    Error on console
    NullReferenceException: GetRef
    AI.OnEnable () (at Assets/!RFPSP/Scripts/AI/AI.cs:90)
    And on AI.cs
    objectWithAnims.GetComponent<Animation>()["idle"].layer = -1;
    How to fix it?
     
    Last edited: May 1, 2015
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Photoshop? !RFPSP/Textures/Hands.jpg and Hands_normal.jpg.

    Did you import into a Unity 4.x project first and then load it in Unity 5.x? The current version RFPS doesn't work if you import it directly into a Unity 5.x project. It also requires a couple extra changes. The steps are here: http://www.pixelcrushers.com/how-to-use-realistic-fps-prefab-in-unity-5/
     
  39. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    how to throw grenade ?
     
  40. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    please also add when no bullet in gun than player also attack with gun like melee weapon
     
  41. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    I have a question, when the bullet shell is ejected from the gun you create 2 objects, one just a RB and the other with the mesh. Why did you separate the two?
     
  42. USTGames

    USTGames

    Joined:
    Feb 24, 2015
    Posts:
    7
  43. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    My ideas :
    Quick melee!
    Enemies keep seeing us if we prone on their view while they chasing us!
    Explosive barrels explode each other! like a chain reaction! :D
    Head hitbox for more reality!
     
  44. Deleted User

    Deleted User

    Guest

    I see what you mean about the ladders, Gua. This is somewhat intentional, to allow the player to quickly exit the ladder if surprised by an enemy, but it would be better to switch the buttons around when climbing, so that the forward and back buttons move straight up and down like the jump and crouch buttons do currently, and jump moves the player back off the ladder. Maybe an option to lock the player to the ladder while climbing by pressing the use button over the ladder would be good too. Thanks for the suggestion, we'll look into this for a future update.


    Hi John, Mecanim animations are working for NPCs in the upcoming version. There are many ways that animations can be configured using Mecanim, so our example character setup can be used as a base to create new Mecanim-animated NPCs.


    When a thirdperson camera is implemented with an animated player character, it should be relatively straightforward to port it to multiplayer after localizing some of the player scripts to a specific player instance, rather than the more global approach that is currently used. A multiplayer update would probably released as a separate addon, since it would change the structure of a project.


    Hi godofwarfare115, a good start would be to look at the FPS Weapons object of the main Realistic FPS Prefab, and view the child weapon objects. You can click on the hands in the 3D scene view and then look at the material and textures in the inspector window, which should lead you to the texture that you can change, like TonyLi suggested.


    No problem, blueLED. Thanks for the support!


    Both of these features are on the todo list, Dawar. Thanks for your patience and feedback.


    Good question, arkon. The same approach is used for the camera and player object as well. The Realistic FPS Prefab is closely tied to Unity's physics system and this is done for optimization and to allow a slower Time.fixedDeltaTime, which helps minimize physics overhead, but has choppier physics updates. A separate mesh or camera object is lerped to the RB position and the end result is smooth movement based on less frequent physics updates, which boosts FPS.


    Hi USTGames, 1.22 is almost done and should be ready this month. Right now it's mostly the documentation, tooltips, and script comments that are being finalized, along with some field testing of the prefab in different scene setups.


    Those are good ideas Takahama! Head hits and melee are on the list. As for explosive barrels, they should already be triggering chain reactions with other barrels and landmines with a slight delay? If NPCs haven't seen the player, going prone reduces their search distance, but once they've detected them, they will search for the player even if they're prone, crouched or standing. We'll look into making the crouch and prone sneak distance reset after the NPC search timer ends.
     
    sluice, QuadMan, Defcon44 and 2 others like this.
  45. TechSinsN

    TechSinsN

    Joined:
    Apr 12, 2014
    Posts:
    121
    Ok this may have been asked already but , how would i make the SoldierNPC not attack me but attack the zombie?
     
    Last edited: May 7, 2015
  46. littlewinch

    littlewinch

    Joined:
    Oct 12, 2013
    Posts:
    7
    One original question (I think)... How would one go about making dual wield weapons where left and right click fire, but without conflicting with the zoom function? Thanks in advance!
     
  47. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    it comes with Update 1.22 ._.
     
  48. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    Assets/FPS Player/Scripts/HUD/HealthText.cs(26,30): error CS1061: Type `UnityEngine.UI.Text' does not contain a definition for `value' and no extension method `value' of type `UnityEngine.UI.Text' could be found (are you missing a using directive or an assembly reference?)
    Going to change healthtext on unity UI, but I have that error.
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Hi - If you're using this post, it's for a Slider, not a Text element. Sliders use value. If you're using a Text element, use text instead, as described in this post for ammo text.
     
  50. USTGames

    USTGames

    Joined:
    Feb 24, 2015
    Posts:
    7
    Release Date of rfps 1.22 ...