Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Realistic FPS Prefab [RELEASED]

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

  1. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    i am having some weird problems, my gun goes 90° automatically.. how to prevent this..on 1.22 it work fine.. on 1.23 having this problems. i have created a new project no link with old one.

     
  2. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    Nope, you need to add yourself.
    Recommend Control freak, you got the really good choice
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Behavior Designer has a free RFPS integration pack.
     
    llJIMBOBll likes this.
  4. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Heres to make RFPS work with RCC
    Put on Vehicle
    Code (CSharp):
    1. public class JimsEnterExitCar : MonoBehaviour
    2. {
    3.     private RCC_CarControllerV3 carController;
    4.     private GameObject carCamera;
    5.     private GameObject player;
    6.     private GameObject dashboard;
    7.     public Transform getOutPosition;
    8.  
    9.     public bool isPlayerIn = false;
    10.     private bool  opened = false;
    11.     private float waitTime = 1f;
    12.     private bool  temp = false;
    13.  
    14.     public GameObject playerincar;
    15.     private AudioListener playerAudioListener;
    16.  
    17.     private bool toggleState;
    18.     private bool toggleGuiState;
    19.     private bool noCrosshair;
    20.     public GameObject FPSWeaponsObj;
    21.     public GameObject FPSPlayerObj;
    22.     public GameObject FPSCameraObj;
    23.     public GameObject MainCameraObj;
    24.  
    25.     public GameObject VisibleBodyObj;
    26.     private CameraControl CameraControlComponent;
    27.     private SmoothMouseLook MouseLookComponent;
    28.     private FPSPlayer FPSPlayerComponent;
    29.     private FPSRigidBodyWalker FPSWalkerComponent;
    30.     private PlayerWeapons PlayerWeaponsComponent;
    31.     private Ironsights IronsightsComponent;
    32.     private VisibleBody VisibleBodyComponent;
    33.    
    34.     void Awake ()
    35.     {      
    36.         playerAudioListener = Camera.main.GetComponent<AudioListener> ();
    37.  
    38.         carController = GetComponent<RCC_CarControllerV3>();
    39.         carCamera = GameObject.FindObjectOfType<RCC_Camera>().gameObject;
    40.  
    41.         if(!getOutPosition){
    42.             GameObject getOutPos = new GameObject("Get Out Position");
    43.             getOutPos.transform.SetParent(transform);
    44.             getOutPos.transform.localPosition = new Vector3(-3f, 0f, 0f);
    45.             getOutPos.transform.localRotation = Quaternion.identity;
    46.             getOutPosition = getOutPos.transform;
    47.         }
    48.  
    49.         playerincar.SetActive (false);
    50.     }
    51.  
    52.     void Start()
    53.     {
    54.         CameraControlComponent = MainCameraObj.GetComponent<CameraControl>();
    55.         MouseLookComponent = FPSCameraObj.GetComponent<SmoothMouseLook>();
    56.         FPSPlayerComponent = FPSPlayerObj.GetComponent<FPSPlayer>();
    57.         FPSWalkerComponent = FPSPlayerObj.GetComponent<FPSRigidBodyWalker>();
    58.         PlayerWeaponsComponent = FPSWeaponsObj.GetComponent<PlayerWeapons>();
    59.         IronsightsComponent = FPSPlayerObj.GetComponent<Ironsights>();
    60.         VisibleBodyComponent = FPSWalkerComponent.VisibleBody.GetComponent<VisibleBody>();
    61.         if(!FPSPlayerComponent.crosshairEnabled){
    62.             noCrosshair = true;//don't reactivate crosshair if it wasn't active to start
    63.         }
    64.     }
    65.  
    66.     void OnApplicationQuit()
    67.     {
    68.         if (isPlayerIn) {
    69.             GetOut ();
    70.         }
    71.     }
    72.    
    73.     void Update (){
    74.  
    75.         if((Input.GetKeyDown(RCC_Settings.Instance.enterExitVehicleKB)) && opened && !temp){
    76.             GetOut();
    77.             opened = false;
    78.             temp = false;
    79.         }
    80.  
    81.         if(isPlayerIn)
    82.             carController.canControl = true;
    83.         else
    84.             carController.canControl = false;
    85.  
    86.     }
    87.    
    88.     IEnumerator Act (GameObject Player){
    89.         player = Player;
    90.         if (!opened && !temp){
    91.             GetIn();
    92.             opened = true;
    93.             temp = true;
    94.             yield return new WaitForSeconds(waitTime);
    95.             temp = false;
    96.         }
    97.     }
    98.    
    99.     public void GetIn ()
    100.     {
    101.         FPSWeaponsObj.SetActive(false);
    102.         FPSPlayerObj.SetActive(false);
    103.         VisibleBodyObj.SetActive(false);
    104.  
    105.         CameraControlComponent.enabled = false;
    106.         MouseLookComponent.enabled = false;
    107.         MainCameraObj.transform.position = carCamera.transform.position;
    108.         MainCameraObj.transform.rotation = carCamera.transform.rotation;
    109.  
    110.         Camera.main.fieldOfView = IronsightsComponent.defaultFov;
    111.  
    112.         playerincar.SetActive (true);
    113.  
    114.         isPlayerIn = true;
    115.  
    116.         CancelPlayerActions();
    117.         //carCamera.SetActive(true);
    118.         ToggleCinemaCamera ();
    119.         if(carCamera.GetComponent<RCC_Camera>()){
    120.             carCamera.GetComponent<RCC_Camera>().cameraSwitchCount = 10;
    121.             carCamera.GetComponent<RCC_Camera>().ChangeCamera();
    122.         }
    123.  
    124.         carCamera.transform.GetComponent<RCC_Camera>().SetPlayerCar(gameObject);
    125.         player.transform.SetParent(transform);
    126.         player.transform.localPosition = Vector3.zero;
    127.         player.transform.localRotation = Quaternion.identity;
    128.         //player.SetActive(false);
    129.         GetComponent<RCC_CarControllerV3>().canControl = true;
    130.  
    131.         SendMessage("StartEngine");
    132.     }
    133.    
    134.     public void GetOut ()
    135.     {
    136.         MainCameraObj.transform.rotation = FPSCameraObj.transform.rotation;
    137.         MainCameraObj.transform.position = FPSCameraObj.transform.position;
    138.         CameraControlComponent.enabled = true;
    139.         MouseLookComponent.enabled = true;
    140.  
    141.         FPSWeaponsObj.SetActive(true);
    142.         FPSPlayerObj.SetActive(true);
    143.  
    144.         VisibleBodyObj.SetActive(true);
    145.  
    146.         CancelPlayerActions();
    147.  
    148.         playerincar.SetActive (false);
    149.  
    150.         isPlayerIn = false;
    151.  
    152.         player.transform.SetParent (null);
    153.         player.transform.position = getOutPosition.position;
    154.         player.transform.rotation = getOutPosition.rotation;
    155.         ToggleCinemaCamera ();
    156.         //carCamera.SetActive (false);
    157.         //player.SetActive (true);
    158.         GetComponent<RCC_CarControllerV3> ().canControl = false;
    159.         GetComponent<RCC_CarControllerV3> ().engineRunning = false;
    160.     }
    161.  
    162.     public void ToggleGuiDisplay(){
    163.         if(!toggleGuiState){
    164.             if(!noCrosshair){FPSPlayerComponent.CrosshairGuiTexture.enabled = false;}
    165.             ////            FPSPlayerComponent.healthGuiObjInstance.SetActive(false);
    166.             //            if(FPSPlayerComponent.thirstGuiObjInstance){
    167.             //                FPSPlayerComponent.thirstGuiObjInstance.SetActive(false);
    168.             //            }
    169.             //            if(FPSPlayerComponent.hungerGuiObjInstance){
    170.             //                FPSPlayerComponent.hungerGuiObjInstance.SetActive(false);
    171.             //            }
    172.             FPSPlayerComponent.helpGuiObjInstance.SetActive(false);
    173.             //            PlayerWeaponsComponent.ammoGuiObjInstance.SetActive(false);
    174.  
    175.             toggleGuiState = true;
    176.         }else{
    177.             //don't toggle crosshair if it wasn't active to start
    178.             if(!noCrosshair){FPSPlayerComponent.CrosshairGuiTexture.enabled = true;}
    179.             ////            FPSPlayerComponent.healthGuiObjInstance.SetActive(true);
    180.             //            if(FPSPlayerComponent.thirstGuiObjInstance){
    181.             //                FPSPlayerComponent.thirstGuiObjInstance.SetActive(true);
    182.             //            }
    183.             //            if(FPSPlayerComponent.hungerGuiObjInstance){
    184.             //                FPSPlayerComponent.hungerGuiObjInstance.SetActive(true);
    185.             //            }
    186.             FPSPlayerComponent.helpGuiObjInstance.SetActive(true);
    187.             //            PlayerWeaponsComponent.ammoGuiObjInstance.SetActive(true);
    188.  
    189.             toggleGuiState = false;
    190.         }
    191.     }
    192.  
    193.     public void ToggleCinemaCamera(){
    194.         if(!toggleState){
    195.  
    196.             ToggleGuiDisplay();
    197.  
    198.             FPSWeaponsObj.SetActive(false);
    199.             FPSPlayerObj.SetActive(false);
    200.             FPSCameraObj.SetActive(false);
    201.             VisibleBodyObj.SetActive(false);
    202.  
    203.             carCamera.SetActive(true);
    204.  
    205.             toggleState = true;
    206.         }else{
    207.  
    208.             carCamera.SetActive(false);
    209.  
    210.             CameraControlComponent.movingTime = Time.time;
    211.             MouseLookComponent.playerMovedTime = Time.time;
    212.  
    213.             FPSCameraObj.SetActive(true);
    214.             FPSWeaponsObj.SetActive(true);
    215.             FPSPlayerObj.SetActive(true);
    216.  
    217.             VisibleBodyObj.SetActive(true);
    218.  
    219.             CancelPlayerActions();
    220.             ToggleGuiDisplay();
    221.  
    222.             toggleState = false;
    223.         }
    224.     }
    225.  
    226.     void CancelPlayerActions(){
    227.  
    228.         WeaponBehavior CurrentWeaponBehaviorComponent = PlayerWeaponsComponent.CurrentWeaponBehaviorComponent;
    229.  
    230.         PlayerWeaponsComponent.StopAllCoroutines();
    231.         CurrentWeaponBehaviorComponent.StopAllCoroutines();
    232.  
    233.         FPSWalkerComponent.jumping = false;
    234.         FPSWalkerComponent.landState = false;
    235.         FPSWalkerComponent.jumpfxstate = true;
    236.         FPSWalkerComponent.CameraAnimationComponent.Rewind("CameraLand");
    237.  
    238.         FPSWalkerComponent.crouched = false;
    239.         FPSWalkerComponent.crouchState = false;
    240.         FPSWalkerComponent.crouchRisen = true;
    241.  
    242.         FPSWalkerComponent.prone = false;
    243.         FPSWalkerComponent.proneState = false;
    244.         FPSWalkerComponent.proneRisen = true;
    245.  
    246.         if(CurrentWeaponBehaviorComponent && !CurrentWeaponBehaviorComponent.PistolSprintAnim){
    247.             CurrentWeaponBehaviorComponent.AnimationComponent.Rewind("RifleSprinting");
    248.             CurrentWeaponBehaviorComponent.AnimationComponent["RifleSprinting"].normalizedTime = 0;
    249.         }else{
    250.             CurrentWeaponBehaviorComponent.AnimationComponent.Rewind("PistolSprinting");
    251.             CurrentWeaponBehaviorComponent.AnimationComponent["PistolSprinting"].normalizedTime = 0;
    252.         }
    253.  
    254.         CurrentWeaponBehaviorComponent.gunAnglesTarget = Vector3.zero;
    255.  
    256.         if(PlayerWeaponsComponent.currentWeapon == PlayerWeaponsComponent.grenadeWeapon && !CurrentWeaponBehaviorComponent.cycleSelect){
    257.             PlayerWeaponsComponent.grenadeThrownState = true;
    258.         }else{
    259.             PlayerWeaponsComponent.grenadeThrownState = false;
    260.         }
    261.  
    262.         PlayerWeaponsComponent.offhandThrowActive = false;
    263.         PlayerWeaponsComponent.pullGrenadeState = false;
    264.         CurrentWeaponBehaviorComponent.pullAnimState = false;
    265.         CurrentWeaponBehaviorComponent.fireOnReleaseState = false;
    266.         CurrentWeaponBehaviorComponent.doReleaseFire = false;
    267.         CurrentWeaponBehaviorComponent.releaseAnimState = false;
    268.         CurrentWeaponBehaviorComponent.fireHoldTimer = 0.0f;
    269.  
    270.         IronsightsComponent.switchMove = 0.0f;
    271.         IronsightsComponent.reloading = false;
    272.  
    273.         FPSPlayerComponent.zoomed = false;
    274.         IronsightsComponent.newFov = IronsightsComponent.defaultFov;
    275.         IronsightsComponent.nextFov = IronsightsComponent.defaultFov;
    276.  
    277.         FPSWalkerComponent.cancelSprint = true;
    278.         FPSWalkerComponent.sprintActive = false;
    279.         FPSWalkerComponent.jumping = false;
    280.         FPSWalkerComponent.landState = false;
    281.         FPSWalkerComponent.jumpfxstate = true;
    282.         FPSWalkerComponent.CameraAnimationComponent.Rewind("CameraLand");
    283.  
    284.         if(CurrentWeaponBehaviorComponent.WeaponAnimationComponent){
    285.             CurrentWeaponBehaviorComponent.WeaponAnimationComponent.Stop();
    286.             CurrentWeaponBehaviorComponent.WeaponAnimationComponent.CrossFade("Fire",0.01f,PlayMode.StopSameLayer);
    287.             CurrentWeaponBehaviorComponent.WeaponAnimationComponent["Fire"].normalizedTime = 1f;
    288.         }
    289.  
    290.     }
    291.  
    292. }
    Put on FPS Player
    Code (CSharp):
    1. public class JimsEnterExitPlayer : MonoBehaviour
    2. {
    3.     public float maxRayDistance = 2.0f;
    4.     private bool showGui = false;
    5.     //private Canvas enterBuggyCanvas;
    6.  
    7.     void Start ()
    8.     {
    9.         GameObject carCamera = GameObject.FindObjectOfType<RCC_Camera> ().gameObject;
    10.         carCamera.SetActive (false);
    11. //        enterBuggyCanvas.enabled = false;
    12.     }
    13.  
    14.     void Update ()
    15.     {      
    16.         Vector3 direction = transform.TransformDirection (Vector3.forward);
    17.         RaycastHit hit;
    18.  
    19.         if (Physics.Raycast (transform.position, direction, out hit, maxRayDistance)) {
    20.             if (hit.transform.GetComponentInParent<RCC_CarControllerV3> ()) {
    21.                 showGui = true;          
    22.  
    23.                 if (Input.GetKeyDown (RCC_Settings.Instance.enterExitVehicleKB))
    24.                     hit.transform.GetComponentInParent<RCC_CarControllerV3> ().SendMessage ("Act", GetComponentInParent<FPSPlayer> ().gameObject, SendMessageOptions.DontRequireReceiver);
    25.             } else {
    26.                 showGui = false;
    27.             }
    28.         } else {
    29.             showGui = false;
    30.         }
    31.     }
    32.  
    33.     void OnGUI ()
    34.     {      
    35.         if (showGui) {
    36.             //enterBuggyCanvas.enabled = true;
    37.         } else {
    38.             //enterBuggyCanvas.enabled = false;
    39.         }
    40.     }
    41.  
    42. }
     
    lolclol and Dawar like this.
  5. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197

    Thanks Tony Li, i have just seen it, and noticed that i need the 80 $ pack to make it work too, so i think ice or emerald would be better because the price.Other thing is that integration is not supported in both of them, so, any other easy and cheaper option to flee behaviour in rfps? Thanks
     
  6. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Maybe your animation no ?
     
  7. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    Hi
    Any1 knows how to make enemys spawned from wavemanager attack your companion AI.
    It seems that they dont attack your companion when they are spawned from wavemanager but they attack if they are spawned from faction manager
     
  8. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    animation work fine on rfps 1.22,
     
  9. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    your 90° problem is on ALL the weapon or only this ?

    If the problem is on the weapon modified by you, so look the other weapon (without problem) and found the difference (value, animation, gameobject etc) :)
     
    OZAV likes this.
  10. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    I'm seriously considering buying this asset but I had a few questions for those who might know the answers.

    * How well does this work on mobile? Anyone have good results?
    * Anyone use it with Google Cardboard?
    * Does this work with VR? I was considering getting a Razor OSVR HMD (and eventually the Leap Motion module) to start VR development. Has anyone used this for VR and had good results?

    Thanks!
     
  11. NeuroToxin-Studios

    NeuroToxin-Studios

    Joined:
    Dec 7, 2014
    Posts:
    68
    I had this exact same problem, to fix it I clicked on the weapon's root object and scrolled down the inspector until you get the "allow gun rotation" option, uncheck the check box and the weapon will no longer do that.
    Hope this helps
     
    OZAV and Ghost_Interactive like this.
  12. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    any idea
    how to open door with hand push?
     
  13. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hey this is perfect, Thanx alot! I also made a couple changes that I'd share.
    I added so it only works if your vehicle is equal or going faster than the set speed you set.
    Code (CSharp):
    1. //Add to Top
    2. public RCC_CarControllerV3 rcc;
    3. [Tooltip ("The speed the vehicle has to be going before it deals damage.")]
    4.     public float speedBeforeDamage = 10f;
    5.  
    6. //Add in OnTriggerStay, above if(hitcol.gameObject.tag == "Player")
    7. if (rcc.speed >= speedBeforeDamage) {
    8.  
    9.  
    10. //Add to end, anywhere after break default break;
    11. }
     
  14. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    Thank you very much.. work for me.
    Another Question is it possible use the knife as COD style with V key !!
     
  15. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    298

    ...Good one, Jim, thanks for the script upgrade, buddy. +1 !
    ...now, they have both versions available :)
    ...*** you can integrate, test, and upload again here, with your changes ?
    ...RFPS community, as it should ... keep alive here, guys...
     
    Last edited: May 22, 2016
    Baraff likes this.
  16. closetgeekshow

    closetgeekshow

    Joined:
    Jun 6, 2014
    Posts:
    125
    Did the way mecanim works change in RFPS 1.23? I'm trying to follow this tutorial for setting up a mecanim npc in 1.22 and the Animation Controller looks totally different (there's no attacking state for instance). Did this change or am I looking in the wrong place? I'm referring to the controller attached to RobotKyle inside the AndroidNPCMecanim prefab.
     
  17. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hey for Mecanim, use the Third Person Controller included with RFPS, open up and you should see 4 boxes and a few more that are empty. Click on one and then drag the animation to the slot.
    The animation names dont need to be exact like legacy, then on the player select use mecanim at the top.

    Easiest way I found was to use the Robot included with RFPS, and dupe it for a new npc, also don't for to after you added a ragdoll also add the damage part scripts to each bone, the head has different damage value
     
  18. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    Do you guys know how to apply force when enemy dies so that it flies away instead of just falling down
     
  19. closetgeekshow

    closetgeekshow

    Joined:
    Jun 6, 2014
    Posts:
    125
    Weird, I just reimported the asset again and I see what you're talking about. I think maybe the "Third Person Controller" name is in conflict with the controller in Standard Assets for Third Person Characters and it didn't import properly.

    @Azuline Studios you might think of changing this filename.
     
  20. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    how to use unity ui for health and ammo, old method are not working on RFPS 1.23. can some one help me
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    llJIMBOBll likes this.
  22. thegamerguynz

    thegamerguynz

    Joined:
    Apr 1, 2016
    Posts:
    20
    Hey guys, need a little help, all of a sudden my bullet impact particles have become huge in size, whats happened?
     
  23. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    Thanks again TonyLi !!
    health Ui working fine now.. but ammo is not working coz the line you used (line 715 & 680) in WeaponBehavior.cs witch are already used for other process.
    & how to use screen space insted of world canvas. please advice... thanks for your help
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @polash - Sorry, I don't understand. I added line 715 first:
    Code (csharp):
    1. if (AmmoText1 != null) AmmoText1.uiText = GetComponentInChildren<UnityEngine.UI.Text>();
    Then I went up to line 680, which is a blank line before the "void Start () {" method, and added:
    Code (csharp):
    1. void OnEnable() {
    2.     if (AmmoText1 != null) AmmoText1.uiText = GetComponentInChildren<UnityEngine.UI.Text>();
    3. }
    This works fine in my project.

    If you want a separate screen space UI for each weapon, just change the canvas type to Screen Space - Overlay.

    If you want to share the same screen space UI for all weapons, handle it like the health bar:
    1. Create a screen space UI with a unique name such as "AmmoUI". You don't have to make it a child of a weapon.
    2. In AmmoText.cs's Start method, find the GameObject and its text
      Code (csharp):
      1. void Start(){
      2.     var uiGO = GameObject.Find("AmmoUI"); //[PixelCrushers]
      3.     uiText = (uiGO == null) ? null : uiGO.GetComponentInChildren<UnityEngine.UI.Text>(); //[PixelCrushers]
      4.   ...
     
    llJIMBOBll likes this.
  25. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    298
    // ============================transfer current forces to RagDoll=====================================

    // For better effect we assign the same velocity to the RagDoll...so, the idea is:
    dead.GetComponent<Rigidbody>().velocity = GetComponent<Rigidbody>().velocity;
    dead.angularVelocity = GetComponent<Rigidbody>().angularVelocity;
    // ===========================================================
     
  26. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    but the main zombie doesnt have any veloctiy since they are driven by navmesh agent
     
  27. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
    I don't know if the question was answered before, but how do I replace characters hand models/textures, while keeping the animations? Do I need to edit that in a 3dsmax or can it be done in Unity somehow?
     
  28. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    one serious problem
    when I import Rfps kit than animation with humanoid not working.
    please tell me what I do.
     
  29. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    298

    ...just add Rigidbody to your "main zombie" object, and use "is kinematic" if
    you have to, if just adding Rigidbody with normal Rigidbody parameters doesn't
    work), so - try both of these, inside added Rigidbody parameters...
    ***When you add a Rigidbody to a game object, only THAN the attached scripts
    to object will work it's magic on it (currently it's how it is - from Unity 5)...
     
  30. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    298

    ...try to un-tick the 'Use Mechanim" in the AI script, and see if it works...
    ...and also try: if you set to "Use Mechanim" in the AI script - that you also
    add a NavMesh Agent to your character... and all else, between these two :)
    eg. - that you first cook the Navigation in your scene, as well,
    (go: Window --->Navigation--->Bake)
     
    Dawar likes this.
  31. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    As expected this doesnt work. Because orgnial zombie doesnt have any velocity so transfered velocity to dead body is also nil
     
  32. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    thank for reply.
    I know about it.
    the animation in animator controller is working well.but when I import RFPS kit. than It stop working
    Any suggestion.
     
  33. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    Hello , you happen to know how to push boxes ? (As in half life1 )
     
  34. closetgeekshow

    closetgeekshow

    Joined:
    Jun 6, 2014
    Posts:
    125
    "the animation in animator controller is working well.but when I import RFPS kit. than It stop working
    Any suggestion."​

    RFPS has its own animation controller for mecanim characters, so it working before you get RFPS in is sort of meaningless. The RFPS controller is named "Third Person Controller" so you might run into problems if you already have an animation controller with that name (this happened to me the other day).

    To fix:
    Rename your controller
    import RFPS
    then follow the steps for making a mecanim npc
     
    Dawar likes this.
  35. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    There is a problem with the ladder when I climb : there is the sound plays but its not climb . how to solve it ?
     
  36. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Even if you look up or down? I found using ctrl and space made my player go up or down if that helps
     
  37. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    298

    ...you can add a rigidbody to "original zombie" ...it will work...
    besides - why not use just original RFPS ragdoll system, if you like that
    aproach more ?
     
  38. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    Amazing bro Its working now.
    Thank youuuuuu so much
     
    closetgeekshow likes this.
  39. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    Really thank you IIJIMBOBII it works
     
    llJIMBOBll likes this.
  40. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    I want o show ammo on a slider bar, i tryd to modify @TonyLi s script but it wont working
    i added
    1. void Start(){
    2. var sliderGO = GameObject.Find("MagUI");
    3. slider = (sliderGO == null) ? null : sliderGO.GetComponent<UnityEngine.UI.Slider>();
    4. }
    then

    1. void Update(){
    2. //only update GUIText if value to be displayed has changed
    3. if(ammoGui != oldAmmo || ammoGui2 != oldAmmo2 || oldWidth != Screen.width) {
    4. if (slider != null) slider.value = Mathf.Clamp(ammoGui / 100, 0, 1);
    5. }
     
  41. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    which ragdoll system are you talking about. One with ccolliders bec that doesnt work either.
     
  42. TauseefCVS

    TauseefCVS

    Joined:
    Mar 28, 2016
    Posts:
    15
    Hello Everyone
    i have one problem , when i unchecked the removePrefabRoot from FPSplayer then weapon change their position and not look the enemy and not have proper aim ,i am use 1.23 version
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Try adding some Debug.Log lines to let you know what's happening:

    Code (csharp):
    1. void Start(){
    2.     var sliderGO = GameObject.Find("MagUI");
    3.     if (sliderGO == null) Debug.LogError("Can't find GameObject 'MagUI'");
    4.     slider = (sliderGO == null) ? null : sliderGO.GetComponent<UnityEngine.UI.Slider>();
    5.     if (slider == null) Debug.LogError("MagUI doesn't have a Slider");
    6. }
    Code (csharp):
    1. void Update(){
    2.     //only update GUIText if value to be displayed has changed
    3.     if(ammoGui != oldAmmo || ammoGui2 != oldAmmo2 || oldWidth != Screen.width) {
    4.         if (slider == null) Debug.LogError("slider is null!");
    5.         if (slider != null) slider.value = Mathf.Clamp((float)ammoGui / 100, 0, 1);
    6. }
     
    Last edited: Jun 2, 2016
  44. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    Thanks again @TonyLi for your help,
    its not working, No errors on console, but i found something on this line i put 30 for 100
    if (slider != null) slider.value = Mathf.Clamp(ammoGui / 30, 0, 1);

    then when ammo is 30 slider is full but after fire one bullet its empty.. linking a video with this & some demonstrating a project witch i am working on. A Stealth Action game (Single Player)

     
    OZAV likes this.
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Use this:
    Code (csharp):
    1. if (slider != null) slider.value = Mathf.Clamp((float)ammoGui / (float)ammoGui2, 0, 1);
    The problem is that ammoGui and ammoGui2 are integers. When you divide them as integers, the value will be either 0 or 1. The line above converts them to floating point numbers so you have have intermediate values like 0.5.
     
    Last edited: Jun 1, 2016
  46. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    the slider value is alway between 0 -1
    try to us mathfclamp01();
     
  47. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    Thanks a lot @TonyLi its working now. i made also some change in ur code
    Code (CSharp):
    1. if (slider != null) slider.value = Mathf.Clamp((float)ammoGui / 30, 0, 1);
     
  48. RobG88

    RobG88

    Joined:
    May 28, 2015
    Posts:
    28
    I found (in the Obstacle Course Test) once in the water and using the ladder that I had to dive into the water a bit and then hit the ladder to climb out otherwise character just stood at the ladder and climbing ladder sound plays.
     
  49. JC_LEON

    JC_LEON

    Joined:
    May 20, 2014
    Posts:
    518
    Hi to all

    I'm back to unity after a long time an dI'm glad to see RFPS growth very well and now has some great addiction like melee weapons, flashlight etc..
    -about there I'm wondering if is there a way i can add battery use to flashlight and batteries to be stored and used when necessary?
    -if is there an easy way to add an inventory to rfps and which is the best and most userfrilenly?
    -are there tutorials or guide on how to import characters and weapons for the lastest release?
    -


    more question to come..LOL
    many thanks in advance...
     
    Last edited: Jun 2, 2016
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    You could set up the flashlight as a weapon and battery charge as its ammo. Look at the posts above for instructions to draw the amount of charge as a Unity UI slider -- for example, something like this:


    If you have the Dialogue System for Unity, it has a free integration package for S-Inventory and RFPS.
     
    llJIMBOBll likes this.