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

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123


    Set velocity Vector3.zero before call Stop();
    navMeshAgent.velocity = Vector3.zero;
    navMeshAgent.Stop();
     
  2. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Thanks Dawar,
    I have put you'r code in the "void start" before the "anim = " but i get this error :

    An object reference is required to access non-static member `UnityEngine.NavMeshAgent.Stop()'
    An object reference is required to access non-static member `UnityEngine.NavMeshAgent.velocity'

    Any idea ? :s

    Thanks
     
  3. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    ma
    In Unity3D you can't instantiate (easily) classes that implement MonoBehaviour. You create them by attaching a script component to existing gameobjects and then you can reference them in the code.

    So to solve this, if you want to call that method, you have to first get a reference to the attached script component that's in the Scene and then you can do it.


    NavMeshAgent nav=this.gameObject.getcompnent<NavMeshAgent>();
     
  4. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    @Azuline Studios When stealth zones added ?
    a collider we become invisible while in it by enemy etc..
    or its just a simple addon to RFPS via script ?
     
  5. NeuroToxin-Studios

    NeuroToxin-Studios

    Joined:
    Dec 7, 2014
    Posts:
    68
    While I have not looked at the AI Scripts for a while surely that would be as simple as making the zone a trigger and then whenever the player enters that trigger toggle off the AI Boolean that seeks the player, I was thinking of adding a similar mechanic to my game.
     
  6. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    make public variable in singleton class
    Code (CSharp):
    1.  public bool isplayerStealthZone=false
    when you trigger enter the stealth zone make it true
    and triggerExit make it false.
    now in enemy class
    make a if check on this variable
     
  7. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    But what if they almost catched you and you just get in a cardboard box ?
    NPC: Oh.. I must have been dreaming..
     
  8. NeuroToxin-Studios

    NeuroToxin-Studios

    Joined:
    Dec 7, 2014
    Posts:
    68
    If I remember correctly there is a Boolean that checks if the player has been spotted (To start chasing/shooting the player), you could check this variable and create an if statement within the stealth zone script so that if you have been spotted by the player, if you go into a stealth zone the player does not get stealthed for a short amount of time.
    For example

    Code (CSharp):
    1. if (playerhasbeenseen == true)
    2. {
    3.       startcouroutine(delayStealth());
    4. }
    and then create a couroutine like this

    Code (CSharp):
    1. IEnumerator delayStealth()
    2. {
    3.      playerIsStealthed = false;
    4.      yield return new WaitForSeconds(5);
    5.      playerIsStealthed = true;
    6.      playerhasbeenseen = false;
    7. }
    this would mean that if the player was spotted and then entered a stealth zone, the couroutine would start and there would be a delay of 5 seconds before the player actually got stealthed.

    This code was thrown together quickly so it probably has syntax issues however this should show what I mean, also I am not aware of the actual variable names so you would have to check them
     
  9. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    Hmm.. Thanks for tips
     
  10. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Please release new version!
     
  11. NeuroToxin-Studios

    NeuroToxin-Studios

    Joined:
    Dec 7, 2014
    Posts:
    68
    It will be released when it is ready mate, I would much rather wait a few weeks more and the final product be perfect than get it early and rushed and have it full of bugs.
     
    Defcon44 likes this.
  12. thegamerguynz

    thegamerguynz

    Joined:
    Apr 1, 2016
    Posts:
    20
    Hi guys, simple question here, How can i alter the mesh of the weapon pickup in unity 5?
    tried several thigns but cant get it to work.

    cheers :)
     
  13. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    I have problem with camera in Unity 5.3.3
    watch:
     
  14. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hum .... What is you'r problem ? :/
    Because i don't see a problem with you'r camera :s
     
  15. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    Are you talking about FOV is your problem?
    There's no problem in video but looks like you're thinking FOV is the problem
     
    Defcon44 likes this.
  16. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    //my English is not good //
    what is FOV ? can you explain for me?
    I think the camera don't records flat and when I rotate camera it is like old curved TV or FishEye effect in photography!
    when rotating camera the items are stretched!
    I didnt see this FOV effect in other video games or even when I was running RFPS on unity4
     
  17. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    FOV = Field of View. i think you didnt like it because view angle is too wide.
    Reduce it from Main Camera / Camera
    Default value is 75 i think ?
     
  18. Dawar

    Dawar

    Joined:
    Dec 7, 2014
    Posts:
    123
    you are playing with free aspect ratio
    try to change it
     
  19. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    No it was not FOV // I have changed it but no change!
    I have set all of the options! but still have same problem!
     
  20. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    Did you changed FOV on FPS Player?
     
  21. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    475
    I have an Issue with what seems to be a Camera Mask or similar which follows the Player/Camera around and casts a cube type shadow over parts of the scene. This varies in position and strength as one rotates the Player/Camera and sometimes covers the whole scene so its not so obvious as it then casts and even grey tone over the whole screen. When partially covering the scene it renders as a hard line shadow (s) over part of the "Normal" area so one has a clear contrast between the normal scene and the cast shadow. i.e. two distinct colour differences. Correct and shadowed.

    This has been following me around permanently for some time and causes visual player grief as it constantly gets in your face as a large visual glitch to spoil the scene enjoyment and gameplay.

    I have attached a screen shot on which I have painted a "Red Dot" at the intersection of sides of what as said seems to be a cubic mask following the Player Camera. The red dot so you can see which are the corner point/sides of the shadow box in question.

    Anyone have any idea what is causing this shadow to follow me around as the player? and how I can remove it? I have tried as many options to change any settings I can find many times to no avail.

    Any help would be appreciated.

    Thank you.
     

    Attached Files:

  22. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    No
    I change it from FPS main camera
     
  23. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    Remove Skybox and try again.
    Or Reflection map got some problems.. Try to disable that too :D
     
  24. petercoleman

    petercoleman

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

    Thanks for that.

    I will have a look at those things.

    Update : Thanks for pointing me in the right Direction. Changing settings for reflection map intensity and a few others in the lighting settings I can balance it out.

    Thanks again.

    Peter
     
    Last edited: Apr 17, 2016
  25. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    You need to change it on FPS Player.
     
  26. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    How to use "Easy Save" to save the player data (FPS Player)
     
  27. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    thanks ! It worked!

    It was 65 by default and I've reduced it to 40

    but there is problem! 40 is look like you are playing in zoom mode!
     
  28. h2oOtter

    h2oOtter

    Joined:
    Jul 16, 2013
    Posts:
    3
    I'm a little confused, and wondering if my recent RFPSP download (for Mac OSX) was missing files.

    In the RFPSP tutorial, it mentions dragging the FPS Main Camera 1 (or 2) to the 3d stage area (I couldn't find either object, just their .prefab docs).

    Can anyone please help (I've attached my RFPSP assets pic).
    https://www.dropbox.com/s/lkcqukffqi0ab28/RFPSP Asset Screen.jpg?dl=0

    Thanks,

    Michael
     
  29. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    What unity version are you using?
     
  30. h2oOtter

    h2oOtter

    Joined:
    Jul 16, 2013
    Posts:
    3
    Unity 5.00 (I'm using FPS Control for now, but hopefully for my next mini game I'll be using RFPSP too)
     
    Last edited: Apr 17, 2016
  31. h2oOtter

    h2oOtter

    Joined:
    Jul 16, 2013
    Posts:
    3
  32. NEQon

    NEQon

    Joined:
    Jan 26, 2015
    Posts:
    1
    Dude, how did such a radar? Casts am, where did you get this radar with screenshots? :)
     
  33. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    195
    Does anyone know if the new version will be using Unity 5 GUI?

    I did not see it mentioned as a upcoming update, but somebody else here may know better.

    Thanks
     
  34. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    No UGUI support in next update. :(
     
  35. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    I used UGUI minimap.
     
  36. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    You need to change it on FPS Player.
    thanks ! It worked!

    It was 65 by default and I've reduced it to 40

    but there is problem! 40 is look like you are playing in zoom mode!
     
  37. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    Hmm.. Then try 50 or 55
     
  38. thegamerguynz

    thegamerguynz

    Joined:
    Apr 1, 2016
    Posts:
    20
    How do I integrate other water assets to interact with the player?
     
  39. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    130
    what is the different between RFPS and UFPS in damage system?

    I mean taking damage and damaging target!

    Because lots of Packages and Projects are match with UFPS !
    So if we change the damage system I think RFPs will be match with them too.

    whats your idea?
     
  40. Deleted User

    Deleted User

    Guest

    Hi Ludo97, apologies for missing your question the first time you asked. I took a look at the documentation for the Easy Save and it seems there are a few approaches to incorporating it in a project. This guide explains how you can save separate variables, or whole components. To use Easy Save with the Realistic FPS Prefab, you will need to get references for the various components and variables of the player, managers, and NPC objects, and save them using the ES2.Save method, then load them using the ES2.Load method. This would take some time, but the results would be worth it. Have you also looked at the Auto Save guide? That way might be quicker to set up.


    The error might be related to the AI.cs script still running, which still is trying to access the navmesh when it's deactivated. Maybe deactivating AI.cs along with the navmesh agent would work better for your pausing script.


    This is a good idea Takahama, and we'll look into it for the next update. Version 1.23 introduces NPC vision cones and silent takedowns with melee attacks, so stealth zones would be a nice addition.


    Hi thegamerguynz, the pickup item game objects are located in Assets\RFPSP\Objects\Pickups and the pickup item meshes (.fbx files) are located in Assets\RFPSP\Models\Item and Pickup Models, which you can import into your 3D app. Please let us know if you have any more questions about this.


    There was another user who reported the same issue, and it appears to be related to having your reflection source in the Lighting->Scene window set as a skybox. There are other options, such as color, gradient, and skybox, which you can experiment with. You might want to check that the textures of your skybox cubemap are uncompressed and the same dimensions. In the 1.22 demo scene, the default skybox cubemap has a smaller 128x128 texture for the lower portion of the cube map than the other 512x512 textures. This is fixed in the next version, in the event it was related to this issue. Hope that helps.


    Hi miJmi, I've seen this happen before and it was related to using a Unity version earlier than what the asset was uploaded with. The main player prefabs should be in the Assets/RFPSP folder. Do you notice the same thing with other prefab objects in the project library (no icon, unrecognized by editor?), or is it just with the player prefabs? You might want to try erasing the downloaded RFPSP unity package (click on the trash bin icon in the downloads tab), and redownloading it again from the asset store. Please let us know if you're still experiencing this issue.


    The next version still uses the GUIText / GUITexture system, but we'll be upgrading to the new UI soon. Thanks for your patience.


    This will be easier in version 1.23 thegamerguynz, since underwater-detection is now based on the main camera position, instead of the player position. To have the swimming behaviors work with a different water system, you can use the default water zone and place the water zone trigger in the volume where the player can swim and go underwater, then deactivate the water plane mesh renderers so the other water effects will be visible. We'll look into better ways to do this in a future version.


    Hi rbm123, the upcoming 1.23 update introduces location damage for NPCs with more precise collision detection. In our opinion, it is on par with professional hit detection used in AAA games. It works by calling an ApplyDamage method on hit colliders of NPC body parts and passing damage, and other hit data to the CharacterDamage.cs script, where ragdoll and other effects are handled. Hope that answers your question.


    As for news on the update, version 1.23 has been uploaded and is going through the review process. This usually takes a week, sometimes sooner, depending on how many assets are in the queue. There is a lot of work that has gone into this update, and it is a huge improvement compared to version 1.22. You can try the web player demo here:


    Thanks for your feedback, patience, and support! Version 1.23 has been tested extensively, but if you find any bugs or things that don't work right, please let us know so we can fix it. Here is a change list for version 1.23:

    • MoveTrigger.cs allows NPCs to lead the player through the scene by detecting when the player enters a sequence of triggers.

    • AzuObjectPool.cs pools frequently used game objects like bullet shells, hit marks, and projectiles.

    • Cookable grenades added as both selectable and offhand throw weapons.

    • Offhand melee/secondary attacks for weapons.

    • Bow and arrow weapons with realistic arrows, that stick into surfaces and can be recollected into player inventory.

    • Sword and shield weapon to demonstrate blocking and melee possibilities

    • Early version of third person mode (incomplete player model animations).

    • Deadzone aiming/free aiming for independent weapon angles from camera. Options for unzoomed free aiming (like ARMA) and zoomed free aiming (like perfect dark, goldeneye).

    • Weapon pivot bobbing for more weapon bobbing variation.

    • Weapon pivot rolling for roll sway and bobbing of weapons.

    • Forward and backward bobbing of weapons.

    • Npc target detection FOV and backstabbing, with customizable weapon backstabbing angles and positioning.

    • Melee weapon blocking, customizable to block only melee, or melee and ranged attacks, option for keeping guard after successful block, or canceling guard after successful block.

    • Reduced dependency on layers for object identification, for better compatibility with deferred rendering.

    • MovePlayerAndCamera.cs releases main camera from script control to allow other scripts to use it for cinema scenes, or other purposes. Also allows teleporting player after camera switch, or without camera switch.

    • Friendly NPCs (faction 1) that can follow player and be commanded to move to a location by pressing the use key over a position.

    • NPC taunt and alert vocal sound effects.

    • Main menu added for scene selection and toggling of game options. Scalable with screen size, or unscaled screen size.

    • AI optimizations, such as preventing inactive NPCs from being added to NPC registry, and caching of data.

    • Water zone caustic effects when underwater and detection of camera submersion, instead of only player submersion.

    • ReconfigurePrefab.cs allows dynamic switching between single camera and dual camera setups and configuration of both setups from one script. There is only one player prefab now instead of FPS Main 1 Cam and FPS Main 2 Cam as in version 1.22.

    • Dual camera setup improved with larger near clip distances to reduce z fighting at long distances from scene origin.

    • Weapon smoke and shell effects made independent of weapon model scale, for consistent effects in dual and single camera setup.

    • Flashlights added as both a separate, selectable weapon, and weapon attachment.

    • NPC locational damage and seamless transition to ragdoll (and back again).

    • Options for initiating bullet time/slow motion for a few seconds after killing NPC or killing NPC with a hit to a certain body part.

    • Improved player capsule friction and velocity handling so player won’t slide down slopes (high friction), but still be able to walks up stairs (low friction) and not launch over obstacles at high speeds (vertical velocity limit).

    • Player capsule customization improvements. Capsule radius value can be set in inspector and camera and capsule heights for various player states customizable from FPSRigidBodyWalker.cs in inspector.

    • Most variables now have tooltips, visible by hovering mouse over them in the inspector. Variable descriptions removed from documentation for quicker updating of docs.

    • Some script variables grouped by subject in inspector.

    • Improved weapon impact and water particle effects.

    • Player capsule and rigidbody no longer get stuck against certain complex, concave mesh colliders.

    • Ejected shells no longer use two game objects (rigidbody and lerped mesh) since fixed timestep is scaled with Time.timescale, which prevents stuttering objects in slow motion and allows the fixed timestep to stay as high/infrequent as possible (optimization).

    • Capsule casts in FPSRigidBodyWalker.cs now ignore trigger volumes (allows player to walk through and crouch/uncrouch in them).

    • Weapon fire framerate independence greatly increased, allowing for more consistent rapid fire rates in varying framerate situations.

    • Holding use button over rigidbody now picks up object, and can be thrown by clicking left mouse, instead of having two separate buttons (Z,X) for these actions.

    • Shading of albedo color for weapon model materials when raycast from player to sun is obstructed, for simulation of shadowing with dual camera setup. Can be toggled to allow for bright interiors or controlled by triggers.

    • Hitmarker crosshair and sound effect for feedback when weapon damages object.

    • Crouch Lean Amt and Stand Lean Amt of FPSRigidBodyWalker.cs allows different maximum leaning distances for standing and crouching states.

    • Reach Distance variable in FPSPlayer.cs allows for customizing the distance player can pick up and activate objects.
     
    Last edited by a moderator: Apr 23, 2016
    Hormic, llJIMBOBll, QuadMan and 4 others like this.
  41. TryHarder

    TryHarder

    Joined:
    Jan 1, 2013
    Posts:
    121
    As for news on the update, version 1.23 has been uploaded and is going through the review process. This usually takes a week, sometimes sooner, depending on how many assets are in the queue. There is a lot of work that has gone into this update, and it is a huge improvement compared to version 1.22. You can try the web player demo here:



    Well Done !!!! Been waiting patiently :)

    Now you can have a sleep before the 100's of 1.23 questions ;)

    Thank you for all your hard work.
     
  42. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Yeah !!! Thanks Azu :D

    I can't wait to get this ^^
     
  43. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    YAY!! Thanks!
     
  44. QuadMan

    QuadMan

    Joined:
    Apr 9, 2014
    Posts:
    122
    Yeahhhh!!Really thanks!!
     
  45. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    perfect, was just starting a new project with ufps but I really dont like. We just need a few intergrations for rfps, like inventory pro and easysave 2. Also a unet or photon intergration wud be awsome.

    Please Unity, Please fast track this update :D :D <3
     
  46. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    in the future, RFPS will throw the UFPS to trash :D
     
    llJIMBOBll and Defcon44 like this.
  47. Deppex

    Deppex

    Joined:
    May 31, 2015
    Posts:
    21
    Is it possible to integrate
    Uicanvas as main menu with the
    "Time.timescale"
    in RFPS and Unity 5.3.3 at me does not work
    I can not click the buttons.
    Is that a problem at
    RFPS or Unity or me self
     
  48. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    I have a main menu as a new scene, I'm not sure what you mean, but sometimes when you back to main menu the time is set to 0? I solved this by creating a new script and just have it set timescale to 1 on start.
     
  49. TryHarder

    TryHarder

    Joined:
    Jan 1, 2013
    Posts:
    121
    1.23 is on the asset store :)
     
    llJIMBOBll likes this.
  50. Deppex

    Deppex

    Joined:
    May 31, 2015
    Posts:
    21
    I want to create a menu in game in real time with UICanvas
    without GUI elements
    I also have a separate scene as main menu but
    if i use Time.timeScale and set it to 0
    then freezes everything
    and my buttons do not respond to mouse
    I want to use Time.timeScale = 0; but
    UICanvas should not be freeze.
     

    Attached Files:

    Last edited: Apr 30, 2016
    llJIMBOBll likes this.