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. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    That's awesome, so I just realized, it is stopping, when I activate it while it is playing, but it is also restarting it. Is there a specific event setup that will allow it to stop completely when I activate it, and then start again only if I activate it again? I know, I'm being a pain lol

    EDIT: I just reread your initial response, I now understand what you meant. But I really appreciate you taking me this far.
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    @Strolski - It'll require a modified script. I'm heading over to the conference now (to demo Quest Machine), but if I can make a little time this evening I'll post something.
     
    Last edited: Oct 3, 2017
    coverpage and Weblox like this.
  3. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    Hey @TonyLi Good luck with the presentation and congrats on the new release. :p
     
    TonyLi likes this.
  4. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    No worries man, have fun at the presentation. You're awesome for the help you've provided.
     
    TonyLi likes this.
  5. TheMessyCoder

    TheMessyCoder

    Joined:
    Feb 13, 2017
    Posts:
    522
    Hi all,
    I am doing a FPS Asset Review Face Off!! It's a review competition where I check out different FPS kits.

    I did an intro of Next-Gen FPS and two videos so far showing the Realistic FPS Prefab.





    Here is the playlist = http://bit.ly/FPSfaceOff
     
  6. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    With RFPS input contol is there anyway to set up an options to allow the player to change buttons? i know i cant change the input manager my self due to unity but converting input controls to keycode seems to not play well with bools.

    I dont want to re write the whole input manager to allow players to change the keys at runtime. Is there a better way?
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    You just need to customize one file, InputControl.cs. I posted a version earlier in this thread that adds Rewired support. It defines a few generic "check input" functions, and then provides an implementation for Rewired. You can use the same code to provide an implementation that uses Unity's standard Input with a lookup table.
     
  8. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    So I've added some characters from the fgc free kits. I'm noticing that when I pull out my flashlight and look at the characters from certain angles, their skin turns black. As I step away, it goes back to normal. It's almost as though a glitchy shadow is occurring. Any chance this is related to my rfps asset?
     
  9. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    So it would appear it was an issue with the character asset itself and I've resolved it by not trying to use the wrong asset clothes with the wrong asset characters :p
     
  10. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    Question, is there a system/trigger box I'm unaware of that allows for a player to take cover and hide within it's radius and the AI can no longer find them
     
  11. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Question about the raycasting eyeline on monsters,,,
    So I have all my monster built on the Zombie monster and they all work very well. Then one day I noticed that all of a sudden my monsters don't charge in and attack like they did. No idea why or what changed. Then I checked "draw debug gizmo" and it shows the eye line pointing off into space. I think just a simple adjustment of changing the raycast eyeline of the characters would fix this. BUt for the life of me, I cannot figure out how to change the eye line position. Rotation of the character models doesn't seem to work. In fact nothing does.


    Does anyone know how to change the eye angle of the monster?

    Screen shot. You can see the eyeline from my monster shooting off into space to the right, but instead should be looking straight forward down the hall..... sysline.png



    Update: Looks as if three of my monsters are all looking at the same point in space. Not sure how this happened. Most likely I made them all from same "root" zombie monster.... Anyone know how to control this?
     

    Attached Files:

    Last edited: Oct 11, 2017
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    The debug line doesn't show the direction that the monster is looking. It's a line between the monster's eyes and the last visible target position.
     
  13. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    47
    Ehi, I have this error in the last version of Realistic FPS Prefab (1.42), using Unity 2017.1.1.

    Assets/RFPSP/Scripts/Camera/VerticalBob.cs(95,28): error CS1061: Type `WeaponPivot' does not contain a definition for `PlayAnim' and no extension method `PlayAnim' of type `WeaponPivot' could be found. Are you missing an assembly reference?
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Back up your project, then delete your old RFPSP folder and reimport the latest version. VerticalBob.cs was removed in the latest version; that's a leftover from a previous version in your project.
     
  15. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Hey guys,

    I'm currently evaluating the available character controllers for my next project, where I'd like to have some seemingly non-standard movement options for the player - I can luckily completely reject the weapons part, though I'm quite impressed with what RFPS has to offer in that regard. The demo is also fun.

    Anyhow, on to the movement part: Is there something prebuilt or something that would keep one from rolling my his own solution for letting the character do a roll to one side (for dodging)?
    Can the player camera turn independently around the y-axis, so that the player can look over his shoulder while still controlling the character as if he was looking ahead?
    How about wall-running, ledge-hanging and all that crazy Prince of Persia-esque stuff?

    Thanks!
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    This is just my personal opinion, so please take it as only one small voice among many. RFPS hard-codes many things to give the controller just the right feeling that makes the demo so fun. But the disadvantage is that this makes it quite difficult to extend with new movement types such as ledge-hanging.
     
  17. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Thank you @TonyLi, I appreciate your input :)
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    [ I'm copying this from the Dialogue System thread: ]
    Hi @ZomBJ - You don't need to use the steps in "How to Respawn With Saved Data". Instead, edit RFPS's FPSPlayer.cs. Add this to the beginning of the Die() method:
    Code (csharp):
    1. void Die () {
    2.     if (PixelCrushers.SaveSystem.HasSavedGameInSlot(1))
    3.     {
    4.         PixelCrushers.SaveSystem.LoadFromSlot(1);
    5.         return;
    6.     }
    This assumes that your checkpoint save is going into save slot 1. If you're using a different slot number, replace "1" with that slot number.

    Note that whenever the RFPS player starts, it will check for a game in slot 1. If you're restarting the entire game from the beginning, you'll want to delete the checkpoint save in this slot by calling PixelCrushers.SaveSystem.DeleteSavedGameInSlot(1).
     
    Franciscotx56 likes this.
  19. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    Hi,

    So I'm noticing that when the asset is imported, it wipes out my Horizontal axis on my project settings > Input settings

    This is affecting other things inability to interact. Is this supposed to happen? Or is it a side effect?
     
    Last edited: Oct 23, 2017
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    It's intentional. RFPS is a Complete Project asset, which means it replaces the project's settings (input, tags, layers, etc.). You'll need to re-add your Horizontal and Vertical axes.
     
    Strolski likes this.
  21. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    Hello,

    I am currently attempting to integrate the "Easy Doors" asset into my game with your use system. By any chance have you done this before? This is more of a preferential system. I can easily have the doors open with a box collider trigger. But I was hoping there was a way I could make the doors trigger via the rfpsp use system rather than a box collider trigger. Any chance you happen to know how to do this? Or would it require some coding?
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    It requires a small amount of coding. RFPS's interaction system calls the method PickUpItem() on targets. Set the door's layer to a layer that RFPS's interaction system recognizes, such as Pickups, and make sure it has a collider so RFPS's raycast can detect it. Then add a small script with a PickUpItem() method that tells the Easy Doors script to open/close.
     
    Strolski likes this.
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Realistic FPS Prefab v1.44 just released.

    Update: The Save System for RFPSP 1.0.5 (updated for Realistic FPS Prefab 1.44) has been submitted to the Asset Store. It should be available in a few business days. You can also download it here using your Unity Asset Store invoice number:
    Save System for RFPSP Customer Downloads

    Upgrade note for 1.0.5: You must delete your existing Pixel Crushers/Common folder before importing version 1.0.5.
     
    Last edited: Oct 28, 2017
  24. TechSins

    TechSins

    Joined:
    Feb 16, 2015
    Posts:
    142
    Not sure of this has been asked before but how do i get rid of this error?
    In order to call GetTransformInfoExpectUpToDate, RendererUpdateManager.UpdateAll must be called first.
     
  25. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    475
    Anyone know if there is any information published regarding what this latest version of RFPS Prefab includes? I have not seen any and have perhaps missed it?

    Thanks

    Peter
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Just the release notes on the Asset Store:
    1.44
    -Fixed missing Project Settings in uploaded versions.

    1.43
    -Fixed AI initialization in Unity 2017.2.
    -Removed HUD GUITextures and GUITexts and replaced with UI Canvas.
    -Fixed stuck arrows becoming unaligned in Unity 2017.2.
    -Added unarmed player character animations.
    -Added allowFirstPerson var to CameraControl.cs for third person only games.

    1.42
    -Removed unused animation events for Soldier@walk animation in Unity 5.2 package version.
    -Fixed player model in third person mode not playing shooting animations when strafing, running, jumping, and firing.

    1.41
    -Fixed spinning of weapon model roll angles when setting up new weapons with certain models.
    -Raised third person camera height when zoomed and swimming to better match camera height when not swimming and zoomed.
    -The third person camera sphere cast now ignores objects with the "Usable" tag to prevent arrows from blocking camera.
    -Added extra check to PlayerWeapons.cs to prevent weapon switching if toggle camera button is being held.
    -Added fpTorsoAlwaysAims var to PlayerCharacter.cs to allow player model to always aim in first person mode (shadow will always aim in look direction).
    -Fixed incorrect weapon rotation if Remove Prefab Root was unchecked.
    -Added new tutorial for changing the player model to documentation.

    1.4
    -Removed VisibleBody.cs and replaced with PlayerCharacter.cs, which animates player character model in third person and creates and animates first person visible body model.
    -Added ThirdPersonWeapons.cs script which holds assets used for third person weapons.
    -Updated animations to use Mecanim and removed all legacy animations.
    -Removed HorizontalBob.cs and VerticalBob.cs and replaced bobbing effects with keyframe animations.
    -Removed Perlin Noise animation of weapon models since the same effect can be achieved with new keyframe animation bobbing.
    -Allowed instant kill triggers to kill invulnerable player.
    -Fixed fire on release weapons not canceling after hiding weapon when climbing or holding objects.
    -Can no longer drop infinite weapons in third person mode.
    -Fixed frame rate dependence of pivot pitch angles.
    -Fixed muzzle flash not rotating roll angle randomly.
    -Added stepHeight and maxStepHeight variables to FPSRigidBodyWalker.cs to allow player controller to automatically detect steps and move up them without needing invisible collider ramps over steps (though they can still be used).
    -Forward obstacle detection capsule cast now checks in move direction.
    -Fixed forward obstacle detection capsule cast when crouching.
    -Fixed offhand grenade not throwing if ammunition was depleted.



    Can you click on the line in the Console window, press Ctrl+C to copy it to the clipboard, and then paste it into a reply here? If the message includes a stack trace, it'll be pasted; that can help narrow down where it's coming from.
     
  27. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    475
    Hi
    TonyLi,

    "Just the release notes on the Asset Store:
    1.44
    -Fixed missing Project Settings in uploaded versions. "


    Thanks for that.


     
  28. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    Great update **1.44 but there is something issue.

    All UI text object used 2 time (for shadow). instate that just add shadow component should be better.
    any planning for dynamic crosshair.
     
  29. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    Hi, two questions...

    How do I change the NPC FOV, to make NPCs not be able to see me if I'm outside their "view cone"? It seems to be set at 180 or so, and I can't figure out if it can be changed.

    And how can I turn off the player FOV change when I sprint?
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    True. But the 2 text objects allow you to have additional effects, too. If you want to switch to UI's Shadow component, you can just disable the shadow object and add a Shadow to the main object.

    Adjust the value on line 712 of AI.cs:
    Code (csharp):
    1. if(Vector3.Dot(toTarget, transform.forward) < -0.45f){
    Inspect FPS Main > FPS Player > Iron Sights and change Sprint Fov to the same value as Default Fov.


    ----------------------------------------------

    Save System for Realistic FPS Prefab 1.0.5 Available

    The Save System for RFPSP 1.0.5 is now available on the Asset Store! Just drop one component on FPS Player to save the player's stats, inventory, and location. This update adds some new, helpful general-purpose saver components such as Active Saver (for GameObjects) and Enabled Saver (for components).
     
  31. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    Thanks for that. Another thing. Once you hold the button to pull back the arrow, you can't do anything but fire it. It would be good to, for example, press r (reload) and it cancels the shot (reverses the pullback animation maybe). Since there's no use for reloading with a bow and arrow anyway, might as well be that button. Unless this functionality is already in there and I'm missing it :)
     
  32. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    475
    I am adding custom characters to my game.

    Been working with Unity a few years and have added some before but now want to add more.....

    When it comes to those that shoot (Enemies, Allies) they work fine except that there is one obstacle I have never found a solution for and that is....

    Bullet tracers : How do I add them to the enemies weapons when the weapon firing takes place? I have never been able to find them attached to characters/weapons, how they work and are set up? I can't even find them on default characters or their weapons?

    Anyone know where they are hiding from me and how to add them to my custom characters weapon firing?

    Custom enemies, weapons, muzzle-flash and all else works fine but I have no Tracers!

    Thank you.

    Peter

    UPDATE : OK Now I seem to have the Tracers working. Thanks

    :)
     
    Last edited: Nov 3, 2017
  33. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    90
    Hi,
    I have loads of problems when i attempt to swap the 3rd person model to another one.
    When entering 3rd person view - the head and arms disappear, using weapons, they turn giant and in the wrong place. Also the model is moving rapidly forward with no user input! I have followed the instructions, and not using a weird model, just a normal one from autodesk character creator as an example.
     
  34. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    Can't seem to locate this one, how do I remove certain options from the menu? Such as resume game or cheats and what not? Not just disable them, but remove them completely.

    Also how do I edit the menu title?

    I figured it would have just been an option in the inspector to handle these. But can't seem to find anything.
     
    magique likes this.
  35. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    HI there.

    version 1.44 Unity 2017.2.0f3

    Just imported the asset into a new blank project and when launching the character just spins in place clockwise.

    any ideas?

    M
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    It's in RFPSP / Scripts / HUD / MainMenu.cs. It uses the legacy immediate mode GUI system (i.e., OnGUI), so it's defined in code. You can comment out the buttons you don't want, and they won't appear in the menu. You may want to also adjust some of the remaining buttons' rects (in code) to repack them tightly in the menu area.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Could it be reading from a joystick? If you have any joysticks connected to your machine, try unplugging them.
     
  38. Strolski

    Strolski

    Joined:
    Jan 9, 2017
    Posts:
    48
    I attempted to comment out button references, but either a. It would cause the button to simply not have an effect, or b. It would cause compile errors in the script. Can you tell me what exactly I should be commenting out for the buttons to disappear?
     
  39. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Near the bottom of MainMenu.cs, there are sections titled:
    Code (csharp):
    1. ///////////////////////////////////
    2. //Left Buttons
    3. ///////////////////////////////////
    and
    Code (csharp):
    1. ///////////////////////////////////
    2. //Right Buttons
    3. ///////////////////////////////////
    In each of these sections, each button has a section of code in this format:
    Code (csharp):
    1.         if (GUI.Button(new Rect(buttonH, buttonV, buttonWidthAmt, buttonHeightAmt), "button name", mainButtonSyle)){        
    2.             // Some code here...
    3.         }
    To disable a button, comment out the button's entire section of code, such as:
    Code (csharp):
    1. //        if (GUI.Button(new Rect(buttonH, buttonV, buttonWidthAmt, buttonHeightAmt), "button name", mainButtonSyle)){        
    2. //            // Some code here...
    3. //        }
     
  40. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    ok now I feel dumb, but thank you :) Solved.

    M
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    No worries; glad I could help.
     
  42. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    Is this mobile ready?
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    It doesn't have built-in mobile controls, but it's really easy to integrate with another Asset Store product called Control Freak. The video steps are here.
     
  44. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    298
    guys, an issue with the Sniper Rifle here. When selected AND player starts to walk: it goes down to player's belly ... it's very annoying ... with other rifles - they stay up properly when player walks ... umm ... ?. any ... Quick fix, anyone ? no fixes i tried so far do anything, going mental about this now :)
     
    Last edited: Nov 8, 2017
  45. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    What can I do to improve the player's ability to move smoothly over small obstacles. I seem to get stuck a lot on small obstacles with box colliders that I should be able to step right over.
     
  46. Arealjighead

    Arealjighead

    Joined:
    Apr 7, 2017
    Posts:
    32
    @magique You can adjust Max Step Height in FPS Player/ Movement Options
     
    TonyLi likes this.
  47. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I must have not seen it, but I looked through every single parameter for every single script and I couldn't find that one. That's exactly what I was trying to find, but couldn't find it. I'll look again.

    [EDIT]
    As it turns out, I was using a very old version of RFPS and there wasn't any MaxStepHeight. I didn't realize how far behind I was. I upgraded and now it's there. Unfortunately, it doesn't work as well as expected even with a very large max step height. I'll have to fine tune the collisions in my level to get a smoother experience.
     
    Last edited: Nov 10, 2017
  48. blueFire

    blueFire

    Joined:
    Nov 27, 2010
    Posts:
    68
    Does it have a way of saving the players stats from scene to scene?
     
  49. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    magique likes this.