Search Unity

Realistic FPS Prefab [RELEASED]

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

  1. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    damn... really dont want to pay 65$, Maybe start a holiday sale for the asset then I would purchase it :)
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    Hold out for a week. I'm going to try to arrange a New Year's sale.
     
  3. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Too late, Lol already purchased it thanks though :D
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    Well thank you for buying the Dialogue System! I'll do my best to make up the difference in support. If you have any questions, please post on the forum thread or email me directly at tony (at) pixelcrushers.com!

    SoumiDelRio is hard at work on the next update to S-Inventory. As soon as it's available, I'll incorporate the enhancements into the integration package so you'll be able to do things like use Medkits straight out of the inventory.
     
    RealAspireGames likes this.
  5. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    So are you still having this sale?
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    I'm submitting version 1.4.2 to the Asset Store tomorrow with a sale price that should hopefully be posted by New Year's! And when the next version of S-Inventory comes out, I'll update the S-Inventory and Realistic FPS Prefab + S-Inventory packages and post them on the Dialogue System customer download site.
     
  7. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    Cool!

    Also, does anyone know how I can make it so the RPFS weapons come with no ammo when I pick them up. Cause right now the AK47, for example, starts off with 30 bullets. I can't the variable that would let me change this.
     
  8. GreenZone

    GreenZone

    Joined:
    Dec 10, 2014
    Posts:
    6
    1.png
     
    TonyLi likes this.
  9. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    That works, but only when I pick up the weapon first. So if I'm holding the AK47 and pick up a another one, it's treated as ammo essentially and I get 30 Bullets added with it.

    What i'm trying to get working is an inventory type system that lets the player hold more than one gun of the same type which they can drop separately from the ammo. But right now when I drop a gun (by instantiating a pickup_prefab) and pick it up again I get ammo added onto the ammo I had before dropping it. Meaning everlasting ammo if you kept dropping and picking it up.
    Hope that makes sense.
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    Weapons in RFPS are implemented like in classic shooters such as Quake, where you either have it or you don't. The cheat (drop and pick up for unlimited ammo) appears to be a bug. To make it more like a classic shooter, you could disable dropping to get around this issue. Or add "return;" to line 105 of WeaponPickup.cs to bypass the code that adds ammo when picking up duplicates.

    Are you using S-Inventory and the Dialogue System by any chance? In the next version, I'll try to add the ability to pick up multiple copies of weapons.
     
  11. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    No I'm the not using them. The "return;" on line 105 works though cheers :)
     
  12. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    This is a great kit! I think it is perfect to add multiplayer :D
     
    RealAspireGames and GreenZone like this.
  13. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    Anyone know where the part of the code is that is responsible for the dropping of a weapon? I'm trying to edit it so in some cases when I call that function it doesn't always instantiate a prefab but still essentially removes the gun from the player.
     
  14. GreenZone

    GreenZone

    Joined:
    Dec 10, 2014
    Posts:
    6
    Please tell me how to change Key Layouty.
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    If you tick Remove On Use on the pickup, it should remove the pickup object when you pick up the weapon. I just tested, and it seems to work fine to address the free ammo cheat. Otherwise, if you want to modify source code, you could jump to line 286 of PlayerWeapons.cs.

    Edit > Project Settings > Input. Expand Axes in the Inspector, and change the keys mapped to actions such as Crouch, Drop Weapon, etc.
     
    GreenZone likes this.
  16. GreenZone

    GreenZone

    Joined:
    Dec 10, 2014
    Posts:
    6
    Thank you very much :D
    And I have another question. Do you know how to tree chopping like this video?
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    Make the tree a stationary "enemy" that doesn't fight back. When it takes enough damage, it dies and gets replaced by a log prefab. This would be a good feature to save for later on, after you've implemented the basics.
     
  18. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    Cheers,

    One other thing, I need to call the function that adds the gun to the player without the weapon actually being picked up so I don't think I can use the pickupobject function in the pickup script since I need to call this from a custom script knowing only the value of the gun to be added.
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    If I understand your requirement correctly, you should just be able to untick the pickup's Remove On Use. If that doesn't do it, take a look at WeaponPickup.cs to see what it's doing under the hood, and use it as a base for your own script.
     
    GreenZone likes this.
  20. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    What I'm trying to do is basically call a function from a custom script that does that exactly the same thing as picking up a gun only without picking it up. If that makes sense.
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    Isn't that what Remove On Use does? When you press 'F' to "pick up" the item, it will be added to your inventory and activated as your current weapon, without removing the object that's sitting on the ground.

    Or do you want to pick it up without activating it as your current weapon? If this is the case, you may need to modify PlayerWeapons.cs.
     
  22. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    No it's that I've made a basic inventory system for myself and when I'm searching a crate and see the gun icon in the crates inventory I can click on it and pressing y should add to my inventory as well add it to the RFPS player in the same way picking up a physical version would.
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    Follow WeaponPickup.cs to PlayerWeapons.cs. When you pick up a weapon, PlayerWeapons.cs sets up that weapon number in WeaponBehavior.cs. Just a suggestion. I'm not the author; there may be a better way.
     
  24. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    I've noticed that in some situations WASD have no affect on the player and I'm just frozen on the spot. Any ideas on this? Is it to do with layers or tags on certain surfaces?
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    When this happens, switch to the Scene view and manually move your player out of its rut. Then go back to the Game view. If you can move, it's a problem with the environment. If you still can't move, it's probably a problem with the player input controls.
     
  26. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    I think I found the solution. I had to set the layer of the environment to default as the layer was empty for some reason. It seemed to fix it.
     
  27. DylaNemesis

    DylaNemesis

    Joined:
    Oct 13, 2012
    Posts:
    7
    anyone know when he plans to release 1.22, hes had to dev preview up for a little while on the site but the package hasn't been updated
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    From the developer:
    Many RFPS users have found and posted about additional tools to fill in the gaps. For example, Behavior Designer has support for RFPS, and it's a great choice for AI.
     
  29. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    XD this is my video lol, yh Tony is right about using enemy damage script and replace with log i also added a replacement to the log to give 2 split in half logs when u hit it agai so it look like u chopped it.. i done the video ages ago and dont have any of it anymore as started new projects, and cant remember excatly what i done but it wasnt to hard

    also only works if u place the trees by hand and not the unity terrain editor
     
    GreenZone likes this.
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    I'll put an example in the next release of the RFPS + S-Inventory + Dialogue System package. The package as a whole won't compile without all three products, but you should be able to grab the tree-chopping script and get it working by itself with little or no changes.
     
    GreenZone and llJIMBOBll like this.
  31. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    I really want Multiplayer support in this asset! I am extremely hopeful that it will maybe be out by the next update.
     
    Defcon44 likes this.
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    What would be a fair price to charge for a networking add-on for RFPS? $15 USD?

    What features would you require?
     
  33. neo_nille

    neo_nille

    Joined:
    Jan 3, 2015
    Posts:
    1
    My player gets destroyed when i load a new level....even if add a script to FPSplayerMain that has the "DontDestroyOnLoad(gameobject) in it....
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    !!!FPSPlayerMain is just a convenience object to make it easy to drag the prefab into your scene. Add the DontDestroyOnLoad script to its children: !!!FPSCamera, !!!FPSEffect, !!!FPSPlayer, and !!!FPSWeapons.

    Or untick Remove Prefab Root on !!!FPSPlayer's WorldRecenter script. (Read the note in WorldRecenter.cs first.)

    Or, if you use the Dialogue System, you can keep a separate !!!FPSPlayerMain in each scene (for easy testing) and let the Dialogue System sync it up from the old scene.
     
  35. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Yea 15$ sounds like a fair price as for features like a lobby system, server browser, and survival game-modes I personally think that would be really fun!
     
  36. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    co-op mode - needs to work with PUN.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    Definitely co-op as well as competitive and survival modes. I may wait until Unity 5 is officially out and use its networking.
     
  38. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Hi Guys, does anyone use the Highlighting System here?

    I got it the other day, and applied the Highlighting renderer component to the Weapon Camera, and the highlights are all displaced incorrectly. It doesn't work if applied to the main camera. Any tips?


     
  39. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    Same things happen with lens flare ( so i moved lens effects to main camera and its fixed)
    Check MainCamera's tags for your effect ^^
     
  40. batuhan123123

    batuhan123123

    Joined:
    Jun 17, 2014
    Posts:
    3
    Can we add car physics on Realistic fps prefab?
     
  41. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    It doesn't work if I put it on the Main Cam unfortunately :(
     
  42. kritchie

    kritchie

    Joined:
    Mar 17, 2013
    Posts:
    7
    Anyone here tried realistic FPS with Unity 5 beta?

    I'm having an issue with the capsule getting stuck on ledges. It's really easy to reproduce. Just create a floor out of a box collider, duplicate it and move the duplicate +0.5 units in Y (and offset the duplicate in X or Z slightly to create a small step). The controller WILL NOT step up onto this 90 degree stair.

    I was able to walk up even higher steps a year ago when I last used this prefab with Unity 4. Things I tried:

    -adjusting the slopeLimit above 90
    -adjusting playerHeightMod
    -adding rigidbody component to stairs
    -adjusting ledge height (around 0.1 it reliably starting stepping up (which is TINY))
    -using a mesh collider instead of a box collider

    Getting hung up on such tiny ledges really breaks the controller and turns it into a frustrating experience.
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    (These steps are now maintained here: http://www.pixelcrushers.com/how-to-use-realistic-fps-prefab-in-unity-5/)

    1. Import RFPS into a Unity 4.x project. Then close the project.

    2. Open the project in Unity 5 and let the script converter do its thing. Steps 1-2 are required because Unity 5 doesn't correctly import the legacy animation assignments on RFPS's prefabs.

    3. Edit the "Player" Physics material or create a new Physics material named "ZeroFriction" and assign its values like this:
    Then assign this material to the FPSPlayer's Capsule Collider.

    4. Make two changes to SmoothMouseLook.cs. In the Update() method, near the top change:
    Code (csharp):
    1. Screen.lockCursor = true;
    2. Cursor.visible = false;
    to:
    Code (csharp):
    1. #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6
    2. Screen.lockCursor = true;
    3. Cursor.visible = false;
    4. #else
    5. Cursor.lockState = CursorLockMode.Locked;
    6. Cursor.visible = false;
    7. #endif
    And near the bottom, change:
    Code (csharp):
    1. Screen.lockCursor = false;
    2. Cursor.visible = true;
    to:
    Code (csharp):
    1. #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6
    2. Screen.lockCursor = false;
    3. Cursor.visible = true;
    4. #else
    5. Cursor.lockState = CursorLockMode.None;
    6. Cursor.visible = true;
    7. #endif
     
    Last edited: Mar 15, 2015
  44. Jack62Lewis

    Jack62Lewis

    Joined:
    Jun 17, 2013
    Posts:
    105
    I had trouble importing assets as input managers were deleting each so now after I've fixed most of the problems I find that when I use the lean right and left buttons on RPFS, ("q" & "e"), my player also moves as well as leans.
    Hope that makes sense.
     
  45. thenamesace

    thenamesace

    Joined:
    Jan 25, 2014
    Posts:
    157
    I had this problem just re-import the InputManager.asset file i made a new project with just rfps in then opened the directory on my harddrive and copied and pasted that file into my real project you can find the file under \Documents\New Unity Project\ProjectSettings then put that in your real project @ \Documents\Real Unity Project\ProjectSettings and overwrite it :)
     
  46. CanthanSnow

    CanthanSnow

    Joined:
    Jan 6, 2014
    Posts:
    7
    I am interested in something like this if it would allow me to use it for split screen play, currently the code only likes running once so creating multiple players doesn't work.
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    I would only provide a networking add-on that works within the existing RFPS framework, so I'm afraid it wouldn't support split screen play.
     
  48. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    196
    I think $15 is to low priced for multiplayer. I think $30 to $40 would be fine.
     
  49. poison77

    poison77

    Joined:
    Dec 24, 2013
    Posts:
    40
    Does anyone know how to start the level with weapon already drawn ? I know that i can set Have Weapon, but its not drawn ( ready ).

    Thanks
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    On !!!FPS Weapons, inspect the Player Weapons script. Set First Weapon to the weapon index of the weapon that starts already drawn. Make sure this weapon has ammo (in the Ammo field just under Have Weapon).