Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Realistic FPS Prefab [RELEASED]

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

  1. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,674
    This means it's running into an error when trying to fire. Does the example scene work? If so, check for differences in the player object in your scene. Try deleting your player object and adding the default RFPS prefab. If that doesn't help, maybe the developer, @Azuline Studios, can provide guidance.
     
  2. appvillas

    appvillas

    Joined:
    Aug 21, 2015
    Posts:
    12
    No, The Example Scene Through This Error
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,674
    Try importing RFPS into a new, empty project. If it works there, look for differences between your projects. If it doesn't work, I suggest contacting Azuline and letting them know what version of Unity you're using. Good luck!
     
  4. appvillas

    appvillas

    Joined:
    Aug 21, 2015
    Posts:
    12
    It is Already In New Project.I am using version 1.21..
     
  5. SteveRyu

    SteveRyu

    Joined:
    Apr 9, 2014
    Posts:
    121
    Hi guys,
    I'm working on the game using RFPS, and I want add shield
    I made it using FPS weapon. It looks nice.
    And now I want to make not receiving damage when shield is on.(Like when gun is aiming, not receiving damage)
    I'm using FPS Main 1 Camera
    I was working shield using FPS main 2 cameras, but FPS weapon hand is too big.
     
    Patico, Deleted User and Defcon44 like this.
  6. Deleted User

    Deleted User

    Guest

    Hi appvillas, something looks to be misconfigured with the prefab. Like TonyLi suggested, you can try starting a new project and importing the asset, making sure that the project settings are imported as well. Another thing to try is clicking the Revert button at the top of the inspector with the FPS Main prefab object selected to reset the prefab's values to default. It's possible that one of the hidden playerObj references are missing, which is causing the null reference error. If you're still experiencing this issue, please send us and email so we can help you further.


    Thanks Takahama, this effect has been minimized, but it's partially intentional, so the shells will stay with the weapon briefly while the camera moves. Yes, the pooling system can be used for weapon projectiles, like the grenades being introduced in the next version.


    Good idea llJIMBOBll, a hit marker would be easy to implement and there will be more weapons added in the next update than any previous one :)


    We'll look into this canaljuegos32, the current behavior of forward only running is intentional, but an option for multi directional sprinting would be a nice addition.


    You can fix this by checking the "Drop On Player Collision" box on the Drag Rigidbody component attached to the FPS Player object. This was being tested in version 1.22, but wasn't reset when we uploaded, sorry about that.


    A toggle flashlight for weapons would be a simple addition. Thanks for the suggestion Takahama.


    Hi J0linar, the code for bows and arrows has been implemented for the next version, modeling and animation just needs to be done for the weapons. The same code is used for the grenades that you can try out in the development preview demo below. Projectile objects can be fired with any weapon, and if there is no projectile prefab reference in the WeaponBehavior.cs component, the default raycast method of weapon firing will be used. Hope that answers your questions.


    Nice job mentolatux, this is exactly what we were thinking with custom weapon models and sounds. We wanted the default assets to be good, but the potential for higher definition visuals and effects is demonstrated well in your video.


    Great work Reality Gaming Studio, we've been thinking about adding a blocking ability too. In FPSPlayer.cs, there is a method called ApplyDamage(damage) which could check for a player blocking state, and either bypass, or minimize the damage that the player receives. Hope that might give you some ideas.


    Apologies for the lack of updates lately, but work on the next version has been constant. We plan to have it ready by the end of the year, with these main additions (green features are complete)
    • Object pooling
    • Grenades and bow and arrows (bow and arrow model needs to be animated)
    • Offhand grenade throwing (grenade throw/select keys)
    • Flashlight utility/melee weapon
    • Updated AI with player-following and go-to commands
    • Melee attacks for ranged weapons
    • Footstep sound effects by terrain texture type (dirt, stone, grass, gravel, sand)
    • Deadzone aiming mode (weapon model moves independently of camera)
    • Weapon sway leading/lagging toggle
    • Weapon shading to simulate shadowing for 2 camera setup
    • Hit marker
    • Weapon flashlight attachment
    • Possibly some surprises :)
    A few things to keep in mind: there is a 5 second fuse for grenades that can be cooked by holding the fire button, the grenade explosion effect is misaligned and will be updated, and the new keys for deadzone aiming and weapon sway are now listed in the F1 help menu. Thank you very much for your support and hope you enjoy the new demo.

     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,674
    Would it work to add a collider that blocks incoming shots? This way @Reality Gaming Studio could set it up to block shots from the front, but the player could still be shot in the back. Or what about temporarily setting the God Mode bool?
     
  8. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    203
    Could we get a shadow cast for RFPS character.
     
    llJIMBOBll likes this.
  9. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    166
    Awesome!!!
    Please keep us updated @Azuline Studios
    Edit: Grenades doesnt have a effect when i throw it into water :p
    (i know its not easy but..) And possibly some water splash with explosions will be good :D
    idea: Make some cool looking weapons with animations and sell it like a addon
    like.. "Advanced weapon pack $9,99"

    Edit 2: if i release L.Click while shooting in burst fire mode, i can end it without shooting 3 rounds!
     
    Last edited: Nov 28, 2015
  10. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    166
    Nah.. i tryed Shield thing like @Reality Gaming Studio
    when i put a collider on shield it pushes player and AI pusing forward to avoid shield
     
  11. SteveRyu

    SteveRyu

    Joined:
    Apr 9, 2014
    Posts:
    121
    Hi guys.
    Is there any way to make controllable turret for RFPS??
     
    Defcon44 likes this.
  12. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    166
    @Reality Gaming Studio With custom scripts, yes! but i dont know how ._.

    Edit(idea): @Azuline Studios i really like to see a checkbox for pooling system mod for shells.
    or, let us set weapon shell chase timer

    Edit 2(idea): @Azuline Studios i see 2 camera has fade effects now. But when i look at sun's direction i see some reflections on weapons. Any way to fix that ?
    like switching model shader or something to hide sun effect

    Edit 3(Bug): Grenade bug!
    When you too close to wall, you can throw it from behind the wall!
    i think arrows do the exact same thing..

    Edit 4(Bug): if you stop holding Fire button on 3 burst mode, you can stop shooting without firing 3 bullets. (On 1.23 Demo)
     
    Last edited: Dec 12, 2015
    Defcon44 likes this.
  13. Ratboy601

    Ratboy601

    Joined:
    Jun 22, 2014
    Posts:
    29
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,674
    Any new content in the new demo? I'm eager to see what happens on the island. :)

    Best of luck on your fundraising campaign!
     
  15. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    251
    Does anyone know how to get the NPCs to be able to see and shoot the player when the player is in an elevated position and / or slightly behind a low height object while in an elevated position.
    For example:
    Player is behind a row a boxes.
    Player can see the NPC very easily and clearly and hence the NPC should be able to see the player, but it doesn't.
    The NPC will try to another position or to get a shot even though it already had one.

    I tried changing this
    targetEyeHeight = FPSWalker.capsule.height * 0.25f;
    to
    targetEyeHeight = FPSWalker.capsule.height * 0.95f;

    Which help the NPC see a little better (still not great) but then the NPC will shoot at the player but not hit the player.. ie. no damage to the player will occur.

    I suspect I must be looking in the wrong area to try and fix this.
    Any ideas on what is wrong here?

    Edit:
    I should have also said that this problem exist in the standard demo too if you go up one of the hills.

    Edit 2:
    Worked around be reducing the collision size on the obstacle. Might be good enough.
     
    Last edited: Nov 26, 2015
  16. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    46
    Realistic FPS Prefab works on mobile?
     
  17. SteveRyu

    SteveRyu

    Joined:
    Apr 9, 2014
    Posts:
    121
    Yes, but you need add controller yourself.
    I recommend to use control freak
     
  18. Halo500

    Halo500

    Joined:
    Apr 24, 2013
    Posts:
    37
    Hello everyone!

    How would I increase the search distance for the AI, specifically the zombies? My player would be in sight of them, but they won't move from their spawn point until I get a lot closer. Once I'm too far away, they just run back to their spawn points... I believe I'd have to change the attack range or something, but it yields no results when I do. Any help? :)
     
    Last edited: Nov 28, 2015
  19. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    46
    What should I do with control freak?
     
  20. SteveRyu

    SteveRyu

    Joined:
    Apr 9, 2014
    Posts:
    121
    Go to InputControl.cs and
    change Input to CFInput.
    And drag CF bootcamp prefab and edit yourself
     
  21. Ratboy601

    Ratboy601

    Joined:
    Jun 22, 2014
    Posts:
    29
    No new levels or anything. Just various tweaks, tons of optimization, and a much more intuitive flashlight. Thanks for your pledge on my Indiegogo! Glad you're looking forward to more. I'm excited for it as well.
     
  22. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    46
    How can I increase the size of the dummy and place the main camera to its new height?
     
  23. Salazar-Aguilar

    Salazar-Aguilar

    Joined:
    Feb 10, 2014
    Posts:
    21
    Hello

    I will like to ask a question about the RFPS system, is simple. Is there a way to let the player reload the weapon even when he is running?, for example, if the player start to reload and then also start to running, the weapon will be still reloading and just after the reload animation finish the running animation will be start.

    Thanks for your time and keep up the good work
     
    llJIMBOBll likes this.
  24. Valga Games

    Valga Games

    Joined:
    Nov 26, 2015
    Posts:
    6
    A good thing
     
  25. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Hi, hopefully someone can help me, i'm using 2 camera setup with both hd main camera set to -1 and weapon 0, main camera is differed and weapon is forward, i have all the image effects on main camera and have a script called CopyToScreenRT.cs i found on UFPS forum, which it does make the image effects show up but they dont go on weapons???

    Does anyone know how to make it so the image effects affect the weapons?

    Thank you :D

     
    Deleted User likes this.
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,674
    Aren't your image effects on the main camera? If you need the image effects on the weapons, you'll also need to add the effects to your weapon camera.
     
    llJIMBOBll likes this.
  27. iraway

    iraway

    Joined:
    Dec 2, 2015
    Posts:
    5
    Hi, I'm interested in purchasing your package to replace UFPS. I'm wondering about a few things:

    - Do you have a good workflow for getting new weapons / equipable items onto a character?
    - Is there any chance you could put together a UNET example like you did with Proton awhile back?
    - How easy is it to add new interactable items like doors, etc., or is this not something you handle?

    Thanks!
     
  28. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    @iraway RFPS is about 407x easier to add new weapons than UFPS, all you need is 3 animations Reload, Ready and Fire also if you have a weapon that requires to add 1 bullet at a time your need a Neutral animation.

    Multiplayer is also something i'm interested in, Tony Li has done a great starter to help integrate with Bolt. I don't own it so i cant try it.

    Doors is pretty simple, the RFPS demo scene comes with doors on a hinge which makes it easier for AI to navigate thru, but if you require like doors that open with a button or trigger i would image it could be fairly easy to do.

    Plus imo RFPS just feels better compared to UFPS and imo easier to use and understand. Plus the next update Azuline Studios is adding a ton new features.
     
  29. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    Hello, I have a bug for the player "FPS Main 2 Cameras" when I go under water, I have a white image and I do not track anything underwater someone can help me please?
    sorry for my English
     
  30. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    It is possible to change the hand or body FPSController ?
     
  31. SteveRyu

    SteveRyu

    Joined:
    Apr 9, 2014
    Posts:
    121
    Yes
     
  32. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    How do we do ?
     
  33. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hey guy's :)

    I make a little up of this post, i think that can be a good feature for RFPS, any idea to make this ?

    Thanks :p
     
  34. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    Hello, I have a bug for the player "FPS Main 2 Cameras" when I go under water, I have a white image and I do not track anything underwater someone can help me please?
    sorry for my English
     
  35. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    There is someone ? how to fix the bug in the water with the FPS player 2. When I go under water, his display any effect under water but a white image on the entire screen ...
     
  36. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Could be due to fog? or HD cameras?, images effects or is the depth set up correct between 2 cameras?

    but if its just when u go under water than thats a weird one, maybe try adjusting water trigger settings during runtime to see, could be fog on the waterscript... sorry i never experienced it.... or if the mesh render turned on on the trigger? that wud be white :/
     
  37. sticklezz

    sticklezz

    Joined:
    Oct 27, 2015
    Posts:
    33
    I'm new to RFPS- Does anyone know how to set tracers for enemy weapons? I see it on the player weapon, but not NPC Attack Script
     
  38. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    166
  39. iraway

    iraway

    Joined:
    Dec 2, 2015
    Posts:
    5
    This is happening to me with the two camera rig. If I turn off the weapon camera it stops happening... also triggered by other random things, very hard to really track down a pattern so far.
     
  40. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    That's the cameras of the weapon that poses a problem when I disables , I see the effects under water but the problem if I disables the cameras I track more weapons .
     
  41. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    I can not use FPS 1 Main Camera bug display there is a saying that goes black texture from far and cross the mountain 's many flashes .
     
  42. SteveRyu

    SteveRyu

    Joined:
    Apr 9, 2014
    Posts:
    121
    Remove Global fog.
     
  43. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    Thank you for your help :) but it 's always the same :(
     
  44. Deleted User

    Deleted User

    Guest

    Sure giraffe1, you can see this in the new version 1.23 preview demo, though the torso animations of the player don't match what the viewmodels are doing just yet.


    It should be possible with some modification of the scripts, Reality Gaming Studio. This would involve creating a state where the RFPSP scripts release control of the main camera and allow a turret control script to update the camera. This is something we'll probably be adding in a future version.


    You might want to experiment with the Eye Height variable of the AI.cs component of the NPC too. If you check the "Use Debug Gizmos" box, a sphere gizmo will be drawn in the editor where the NPC starts their line of sight check to their target. Some character models have their origin at their feet, which necessitates increasing the Eye Height var to make their line of sight check start at their eyes, instead of at their feet. We'll do some more testing with this too.


    Increasing the Attack Range variable of AI.cs should allow you to expand the search radius of the NPCs. If you want them to follow the player at very large distances, their search timeout might be elapsing before they reach the player. We'll look into this. You can also check the Hunt Player box if you want them to follow the player across the map.


    The Player Height Mod var of FPSRigidBodyWalker.cs can be increased/decreased to change player height as needed. Hope that helps.


    Hi, we've recently added an option to allow the player to sprint in all directions, in addition to forward-only sprinting. We'll add an option for reloading while sprinting too. Thanks for your feedback.


    Hello, there are a few ways to add new weapons, you can either use a new view model, or swap parts of existing models like hands or weapons, while maintaining the original object's animated position and rotation. Adding a new weapon just involves duplicating an existing child of the FPS Weapons object, renaming it, then adding it to the Weapon Order array of the PlayerWeapons.cs script on the parent object, which tracks the order of selectable weapons. The Weapon Mesh object of WeaponBehavior.cs just needs to be set to your weapon model and the model should be assigned to the "gun" layer.

    A UNET example is possible in the future, once we've implemented a few more features like third person mode, which can be used to animate other player characters.

    By default, interactive objects can be created by giving them a collider component, setting them to the "Usable" layer, and writing a script with a method called "ActivateObject" which will be called when the player presses the use key while looking at the object. This can be used for buttons, doors, and elevators. If you have any more questions about this, please let us know.


    Sure, in NPCAttack.cs, you can create a reference to the WeaponEffects.cs component that has a method for playing bullet tracers. In NPCAttack.cs line 7, below "private AI AIComponent;" you can add:

    Code (CSharp):
    1.     private AI AIComponent;
    2.     private WeaponEffects WeaponEffectsComponent;
    Then below "AIComponent = myTransform.GetComponent<AI>();" line 56, set the WeaponEffectsComponent reference in OnEnable(),

    Code (CSharp):
    1.         AIComponent = myTransform.GetComponent<AI>();
    2.         WeaponEffectsComponent = AIComponent.playerObj.GetComponent<FPSPlayer>().weaponObj.GetComponent<WeaponEffects>();
    Finally, add this code below "targetDir = (targetPos - rayOrigin).normalized;" in the FireOneShot() method, line 152, to call the weapon tracer method for NPC shots,

    Code (CSharp):
    1.         targetDir = (targetPos - rayOrigin).normalized;
    2.         if (muzzleFlash){
    3.             WeaponEffectsComponent.BulletTracers(targetDir, muzzleFlash.transform);
    4.         }
    And the NPC's shots should have tracers now.


    Much appreciated @Takahama. Edit 3 & 4 have been fixed in the new demo. Edit 1 has been adressed by disabling shell following during bullet time and deadzone aiming, but we still will add a multiplier that can be used to deactivate or increase the shell following time.

    For edit 2, do you mean that when you start the scene, the Sun Shafts effects look incorrect? That image effect can be deactivated or removed, or it might be because the sunlight (directional light) reference of SunShafts.cs has not been assigned, you can add this to SunShafts.cs to automatically try to find the sun light object in the scene:

    Code (CSharp):
    1.         void Start (){
    2.             //automatically assign sunlight
    3.             if(!sunTransform){
    4.                 Light[] lightList = FindObjectsOfType(typeof(Light)) as Light[];
    5.                 for(int i = 0; i < lightList.Length; i++)    {
    6.                     if(lightList[i].type == LightType.Directional && lightList[i].gameObject.activeInHierarchy){
    7.                         sunTransform = lightList[i].transform;
    8.                         break;
    9.                     }
    10.                 }
    11.             }
    12.         }

    Hi @Ludo97 you might want to try deactivating or removing image effects attached to the cameras, like chromatic aberration, bloom, color correction, anti aliasing, sun shafts, depth of field, and global fog, to rule out that the shaders are the issue. The advanced water shaders have also caused a white screen if you're using two cameras and the second/weapon camera's rendering path is not set to "forward." There is also a shader used for the water under the surface which could be outdated. You can import the newest versions from Unity's standard assets packages and use them instead, if needed. If you're still working on this, please feel free to send us an email so we can exchange screenshots and continue the troubleshooting process. Thanks for your patience.


    A new preview demo of version 1.23 is available. The main additions since the last demo are:
    • Offhand throwing of grenades by pressing/holding the middle mouse button
    • Greatly improved timing and framerate independence of shot timer (most noticeable with auto fire)
    • Optimized particle/explosion/effects code
    • Flashlights for the MP5 and Shotgun that can be toggled by pressing "L"
    • Hitmarker and sound for NPC and destructible object hits
    • NPCs (non-wavespawning) that you can sneak up behind and do extra melee damage
    • Leaning around corners does not alert NPCs anymore (unless attacked) so the player can survey an area undetected for stealthy gameplay
    • Optional multidirectional running (active in preview demo)
    • Shadow of visible player model cast in scene

    Known issues to be fixed:
    • Multidirectional running does not snap to full speed with joystick movement
    • Player model that casts shadows does not have correct torso/arm animations (to be fixed in later version after 1.23)

    Remaining features in progress for Version 1.23:
    • Melee attacks for ranged weapons
    • Bow and Arrow Animations
    • Additional AI improvements
     
  45. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    182
    Any timeline on the 1.23 release date?
     
  46. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Is there an easy way to add a projectile to a weapon like a rpg or grenade? which in inspector has a bool on off so can choose which gun uses it. also I have a flame thrower I want to add, not sure how to do it, need to add a particle system which damages. Thanx
     
  47. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    166
    i mean while inside building i still can see sun reflection on faded weapon and hands when i look at sun's direction
    any way to disable it while inside a building ? (if you can change fade level of a texture to simulate shadow, then its possible to change other things ? like editing Shininess or Specular while inside building ?)

    EDIT: and please add a collider while player inside it NPCs cant see the player unless player attacked or NPC is chasing. It makes player can sneak on bushes

    Test.png
     
    Last edited: Dec 14, 2015
    Patico likes this.
  48. NeuroToxin-Studios

    NeuroToxin-Studios

    Joined:
    Dec 7, 2014
    Posts:
    68
    Why not create a collider around buildings and then write a quick script that toggles the bool that controls sun shafts? only problem with this is that if you were inside and looked out it might look weird.
     
  49. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    Azuline thank you for your answer, the bug is fixed , it's very good jobs this pack, thank you very much
     
    Deleted User likes this.
  50. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    Azuline, I have another question, it is possible to change the player's hand and it is possible to simply remove the body of the player? thank you and sorry for my english
     
unityunity