Search Unity

Realistic FPS Prefab [RELEASED]

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

  1. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    @Azuline

    Is there an easy way to disable only bullet marks, but keep the spark, smoke, etc.? I tried setting the Bullet Mark Obj element sizes on every weapon to 0 to clear out the bullet mark texture references, but it also removed all hit impact effects :)
     
  2. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    In Inspector view in Tags choose NoHitMark on object you want to have no bullet marks.
     
  3. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Thanks, Dari!


     
  4. Deleted User

    Deleted User

    Guest

    No problem Venged, glad you got it working and are enjoying the asset. We've definitely put a lot of time and effort into the Realistic FPS Prefab. Thanks for the kind words and your support. We really appreciate it!


    Hi Dari, are you referring to the crosshair/hand icon that changes when you are looking at an item? That code can be found in FPSPlayer.cs script. If you want to make GUIText fade like the "Press F1 for controls" message when you start the scene, you can find that code in HelpText.cs. The message fades because the alpha element (tempColorVec.w) of the GUIText's color is decreased over time. Here is the line of code that fades out the help message:

    Code (csharp):
    1. tempColorVec.w -= Time.deltaTime;//fade out color alpha element for one second
    The GuiText's color is then set to the tempColorVec which uses the fourth element of the Vector4 for the GUIText color's alpha amount which eventually reaches zero and makes the text invisible. Does that answer your question?


    That's right, you can disable hit marks on a specific object by appying the NoHitMark tag, thanks Dari. If you wanted to remove them altogether, you could comment out line 763 of WeaponBehavior.cs which looks like this:

    Code (csharp):
    1. BulletMarks(hit);//draw a bullet mark where the weapon hit
    We plan to update our docs with more information on these kind of details, but feel free to ask any questions you have in the meantime. The next update will include a reworking of how weapon effects are handled, which places effects like bullet marks, sparks, and smoke all in one script for easier customization.
     
  5. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Even better.
     
  6. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    Azuline, how can I choose which Waypoint is for which Robot? Thanks, I hope you understand what do I mean.
     
  7. Mustafa Adil

    Mustafa Adil

    Joined:
    Dec 6, 2012
    Posts:
    21
    hi, im having a problem in attaching the FPSPlayer2 script to other object. im having two errors first one is:

    UnassignedReferenceException: The variable healthGuiObj of 'FPSPlayer2' has not been assigned.

    and the second one is:

    UnassignedReferenceException: The variable healthGuiObjInstance of 'FPSPlayer2' has not been assigned.

    NOTE: FPSPlayer2 is the script in which i have removed everything just leave the health related code. Basically i want this script to behave as only health script with health showing on hud.

    Anyone who can help?
     
  8. Deleted User

    Deleted User

    Guest

    In the current version (1.16) there isn't a way to define which waypoints the NPC follows. The NPCs in the 1.16 code follow the waypoints that are nearest to them and the waypoints are grouped based on their line of sight to other waypoints. The reason the NPCs in the demo scene follow their own sets of waypoints is due to the fact that the separate waypoint groups cannot "see" the other groups.

    To improve the NPC patrolling behavior, we added the var myWaypointGroup to the AI.js script and added the waypointGroup var to AutoWayPoint.js script. The new AutoWayPoint.js script checks the waypointGroup number of a waypoint and groups the waypoints based on their shared waypointGroup number, even if the waypoint groups can see each other. The myWaypointGroup var of AI.js allows you to set which waypoint group the NPC should follow.

    So with the updated scripts, you could have two NPCs patrolling side-by-side and within sight of each other using different patrol paths. I'll send you a PM with the new scripts that you can add to your project. If anyone else wants these updated scripts before the next version is released, you can send us a PM as well.


    You're probably getting these errors because the healthGuiObj object hasn't been defined. By default, the Realistic FPS Prefab scripts are set up to work within the structure of the prefab itself with certain public variables being hidden from the inspector for ease of use. First of all, you should comment out the [HideInInspector] statement before the healthGuiObj var in FPSPlayer2.cs so it looks like this:

    Code (csharp):
    1.     //[HideInInspector]
    2.     public GameObject healthGuiObj;//this object is instantiated for heath display on hud
    3.     [HideInInspector]
    4.     public GameObject healthGuiObjInstance;
    Now you can select the FPSPlayer2.cs script component of your object and drag the HealthText object from the !Realistic FPS Prefab Files/!Objects/HUD folder in the project library window to the Health Gui Obj var of the FPSPlayer2.cs script component of your object in the inspector. You can delete the comment slashes you just added before [HideInInspector] as well to clean up the inspector after this is done if you want. Hope that answers your question.
     
  9. wana7262

    wana7262

    Joined:
    Jul 2, 2012
    Posts:
    103
    how can i add mobile FPS controller on it?
     
  10. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    Thanks alot, Azuline! Robots now follow their Waypoints!
     
  11. Mustafa Adil

    Mustafa Adil

    Joined:
    Dec 6, 2012
    Posts:
    21
    im still getting the errors. I've mailed you with details please check it out. And waiting for your reply. Cheers!
     
  12. Deleted User

    Deleted User

    Guest

    Hi wana7262, adding mobile support to the current version of the Realistic FPS Prefab is possible, but will take some research. We have worked with a customer who implemented mobile input controls and we made a blog post about it here. We will look into adding mobile support at a later date after we've added some more features to the asset.


    Good to hear Dari, thanks for reminding us to add waypoint groups for the AI.


    Ok we sent you an email with the example health display method from our asset. Hope that helps with your project!
     
  13. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    No problem for reminding you, Azuline :)
    Just one question: When I scale my !!!FPS Player Main it won't work in game-play mode. (won't walk, run...)
    Any ideas how to fix it? (reason: when my terrain is big and character small, if I use terrain paint tool, Brush size is too big and it can't be smaller than 1)
    In the next update, I won't have to hold "z" button to drag items, I'll just have to press it once and it will automaticaly be holding in air?
     
    Last edited: May 16, 2013
  14. Mustafa Adil

    Mustafa Adil

    Joined:
    Dec 6, 2012
    Posts:
    21
    Yeah i've taken a look at it. Thanks for the reply mate.

    I've mailed you again kindly have a look at it. Waiting for your reply. Cheers!
     
  15. mngmhds

    mngmhds

    Joined:
    Feb 2, 2013
    Posts:
    21
    Just purchased this amazing prefab, and I have to say that it is the best thing since sliced bread. I wouldn't mind further clarification about adding NPC waypoints and managing which waypoints the NPC's path to, but overall the documentation is great. As for the quoted text I'm still waiting on a zombie model with it setup for melee! :)

    PS. Application.Quit() crashes the Windows stand-alone. Remedied by going to the FPSPlayer script and changing it to System.Diagnostics.Process.GetCurrentProcess().Kill();
     
    Last edited: May 17, 2013
  16. Deleted User

    Deleted User

    Guest

    Interesting solution you've thought of for the terrain paint tool size. Unfortunately, scaling the Realistic FPS Prefab isn't supported in the current version. The reason that the the player won't walk or run after you've scaled the prefab is due to the capsule collider heights being hard-coded in the FPSRigidbodyWalker.cs script, which calculates the movement of the player. Though we will look into having the capsule height checks scale with the collider for a future update.

    The alternate pickup style might be in the next update. We're almost finished with 1.17 and depending on how easy the the pickup feature is to implement, it might be included. Otherwise it should be in the update after 1.17. We don't want to delay 1.17 much longer because it contains the weapon position bug fix, along with some other nice additions :)


    Thanks, we sent you an example project with the changes you were asking about. Hope that helps!


    Thanks rcgmhds! The documentation is going to get an update soon. We're going to add more detailed descriptions of the AI and non-FPS scripts. The waypoint system in 1.16 is admittedly very basic, but we just added waypoint groups to the AutoWayPoint.js and AI.js scripts to allow the NPCs to follow their own group of waypoints (designated by a waypoint group number), instead of having the waypoint groups be linked by line of sight as they are currently. We will send you a PM with the updated scripts and instructions so you won't have to wait for the next update.

    We have a zombie model, but the animations need some more work. Though the next update might have a non-zombie melee NPC. If you wanted to use your own NPC mesh you could change the Shoot Range and Dont Come Closer Range values in the AI.js script instance of the enemy object to 2 and the NPC would move to melee distance before attacking the player.

    We were wondering about the Application.Quit() issue. We thought it was just our setup because exiting works without errors in Unity 3.5, but in Unity 4.1 it crashes on exit. This is reportedly getting fixed in version 4.2, but we'll use the method you shared until then. Thank you!
     
  17. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    Okay, thanks for reply Azuline! :)
    What must I do for this: When I collect <amount> of items (items like guns, ammo for guns and health) then I win the game. (for example shows up GUI texture and says: Retry or Exit) If pressed Retry happens the same thing as I would press V button and if pressed Exit loads level <levelname>?
    I know it's a bit complicated and too much maybe.
     
    Last edited: May 17, 2013
  18. mngmhds

    mngmhds

    Joined:
    Feb 2, 2013
    Posts:
    21
    Thanks for the thorough reply and the private message! Are grenades and explosions going to be in the next update?

    Edit: Figured out my ragdoll problem, silly me. I set the root to the wrong joint!
     
    Last edited: May 18, 2013
  19. Mustafa Adil

    Mustafa Adil

    Joined:
    Dec 6, 2012
    Posts:
    21
    Thanks a lot Azuline Studios, problem is solved !
     
  20. Deleted User

    Deleted User

    Guest

    To add the game winning condition you could create a game manager script which would have variables that would keep count of the amount of items that you have picked up. The pickup scripts could also be modified to increment the item count in the game manager script which would then display the game winning message and restart the scene when you've collected the winning amount of items.

    For the pickup scripts, here is a rough example of the code you would need to add:

    Code (csharp):
    1. //variable initialization at top of script
    2. public GameObject gameManagerObj;//should be set by dragging object with the GameManagerScript attached in the inspector
    3.  
    4. //in the PickUpItem() function
    5. GameManagerScript GameManagerComponent = gameManagerObj.GetComponent<GameManagerScript>();//cache game manager script component
    6.  
    7. GameManagerComponent.itemCount ++//increment the item count in the game manager script by one when item is picked up
    In the Game Manager script you could have some code like this:

    Code (csharp):
    1.  
    2. //variable initialization at top of script
    3. [HideInInspector]//hide itemCount since it won't need to be set in the inspector, but make it public so other scripts can change it
    4. public int itemCount = 0;//current amount of items that player has collected
    5. public int winningAmount = 10;//number of items needed to win, can be set from the inspector
    6.  
    7. void FixedUpdate(){
    8.     if(itemCount >= winningAmount){
    9.         //display game winning message, fade screen, and restart or load next scene
    10.         //if loading another scene, you can use code like this:
    11.         Application.LoadLevel ("levelname");
    12.     }
    13. }
    Those examples aren't full scripts and won't compile, but they are roughly the changes that would need to be made. For efficiency, the level restart code in FPSPlayer.cs could get taken out of the FixedUpdate() loop and added to it's own function like RestartLevel() which would be called both when the player presses V and when the winning amount of items are collected.

    We wish we could help you implement the exact code for game winning conditions, but we are really busy at the moment working on the next update. We have considered making the Realistic FPS Prefab's demo scene more game-like using a game manager like we've described, so further down the road we might be implementing behaviors like this for winning conditions and wave-spawning enemies. Hope that answers at least some of your questions Dari.


    No problem rcgmhds, grenades and explosions aren't going to be in the next update, but we've got the basic framework in place and they should be in the update following this one. There's just a few more features we're finalizing for 1.17.

    Nice work with the ragdoll problem. You just have to add character joints, rigidbodies, and colliders for each bone/hierarchy element and make sure the Connected Body of the character joint is correct. If you add the Character Joint first, Unity also adds a rigidbody component, which saves some time. Setting up ragdolls does take some patience, but the end result is worth it!


    Glad to hear! Best of luck on your project :)
     
  21. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    Thanks Azuline, I know you are busy, sorry for so complicated questions, that what you wrote was also pretty enough, maybe even too much!
    You are really helpful to others, by the way, I'm going to try to make the whole script :)
    Here is the link for one NPC spider with animations (I didn't made it... Max or Oth needed, if you have one of these, you must register on TurboSquid website and press Free Download in the right upper corner)
    http://www.turbosquid.com/3d-models/free-spider-animations-3d-model/398764
    Didn't test it already, I will as soon as possible.
    Autodesk Max and Oth are 3D modeling softwares.
     
    Last edited: May 19, 2013
  22. sicga123

    sicga123

    Joined:
    Jan 26, 2011
    Posts:
    782
    Hi
    I'm having a problem getting the weapon to show in the scene. I'm using a NGUI camera as well to show a set of buttons. The gun in the prefab does not show in either camera view in the prefab when it is running, it does show in the game view. Is there a public variable I am supposed to set to make it show?
    I checked the PDf but this seems mainly to deal with cretaiing a custom weapon. Of course I could be wrong and have missed the obvious still I would appreciate a pointer if possible.
     
  23. Deleted User

    Deleted User

    Guest

    No problem Dari, glad to help out. And thanks for the link to the spider model, we'll have a look!


    Hi sicga123, if the weapon model is not showing when using a camera setup other than the default, there might be an issue with the weapon camera and main camera culling mask settings. By default, the Realistic FPS Prefab uses the Main Camera for rendering the scene and the Weapon Camera, which has a higher depth value than the main camera, to render the weapon elements.

    You might want to check that your NGUI camera's culling masks include layer 8, the gun layer. If that doesn't work, you could try setting the culling layers of the main camera to include layer 8, and disabling the weapon camera. If disabling the weapon camera, the weapon models would need to be moved closer to the main camera's origin/position as well to accommodate the higher FOV value of the main camera. Feel free to contact us again if neither of these solutions work to get the weapons rendering using your NGUI camera.
     
  24. AlcatrazAlex

    AlcatrazAlex

    Joined:
    Aug 6, 2012
    Posts:
    83
    Hellow! Your system good. But i comile project and dont see any weapons. Console (write for real-time) show me a lot of "Nullreference" 's.
    In Editor, all works fine! Unity 4.1.1f.
    Please, help.

    weaponsOrder array's length = 0.. why?
     
    Last edited: May 22, 2013
  25. Deleted User

    Deleted User

    Guest

    Thanks AlcatrazAlex! Since the errors say the weaponOrder array length is 0, it means that the PlayerWeapons.cs script component of the FPS Weapons object is not configured correctly. First of all, have you made any modifications to the Realistic FPS Prefab since you've imported it, or are you trying to run everything with it's default configuration?

    If you haven't made any changes to the asset, the error message indicates that there might have been a problem downloading or importing the asset into Unity. The first thing we suggest doing is starting a new empty project and going to the asset store download manager, clicking on the Realistic FPS Prefab download title so you are taken to the store page for the asset, and then click on the down arrow next to the import button and select "Redownload and import" and allow Unity to download and import the asset without using Unity or any resource intensive applications until the process is complete.

    You can also try deleting the downloaded package found in C:\Documents and Settings\YourName\Application Data\Unity\Asset Store\Azuline Studios (XP) or C:\Users\YourName\AppData\Roaming\Unity\Asset Store\Azuline Studios (win7) and then re-download it from the asset store and try importing again.

    When importing manually, if you right click on the Project Library window and go to Import Package->Custom Package and the Import Package window pops up after selecting the Realistic FPS Prefab package, please make sure that the "All" button at the bottom left of the window is clicked and all the assets in the Import Package window have a check box next to them.

    If you are still getting errors after reimporting using the above methods, could you select the FPS Weapons object located in the Hierarchy window under the !!!FPS Main object, and expand the Weapon Order array and verify that the array length is 7 and there are weapon names listed underneath starting with !Unarmed and ending with Sniper? If the Weapon Order array length is still zero, you can try clicking on the !!!FPS Main object in the Hierarchy window and clicking on the revert button to restore the prefab's default configuration. This video will show you how the weapon system works in our asset if you want to set up the weapons manually.

    You can also try removing the compatibility checks in PlayerWeapons.cs which deal with activating weapon objects. There are two sections of code where you can comment out the lines for Unity 3.5. Starting at line 254 you can make this change:

    Code (csharp):
    1. //                #if UNITY_3_5
    2. //                    // Activate the selected weapon
    3. //                    weaponOrder[i].SetActiveRecursively(true);
    4. //                #else
    5. //                    // Activate the selected weapon
    6.                     weaponOrder[i].SetActive(true);
    7. //                #endif
    and at line 357 make this change:

    Code (csharp):
    1. //                #if UNITY_3_5
    2. //                    // Activate the selected weapon
    3. //                    weaponOrder[i].SetActiveRecursively(false);
    4. //                #else
    5. //                    // Activate the selected weapon
    6.                     weaponOrder[i].SetActive(false);
    7. //                #endif
    Sorry if this is a lot of information, but I'm just trying to predict what could be causing the errors you've described, starting with the simpler fixes, and moving on to more complicated ones. If the demo scene is still not working, could you please paste or PM some of the exact errors you're getting so we can get a better idea of the issue? Thank you for your patience.
     
    Last edited by a moderator: May 23, 2013
  26. AlcatrazAlex

    AlcatrazAlex

    Joined:
    Aug 6, 2012
    Posts:
    83
    Thanks, but I make some changes in scripts, when I launch in editor , all works fine. But in Windows (x86_x64) build, guns in air , and if I get left mouse button, fire all guns. And all guns activated. My in-game console show me nullreferences..

    Thanks in advance,
    best regards,
    Alex.
     
  27. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    226
    (I want) Player walk (or run) from point A to point B automatically .

    What should I do?
     
  28. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    Hello everyone, does anyone has idea for this: If I create Directional light and put a flare on it, it doesn't shows the flare in gameplay.
    Thanks!
     
  29. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    @Azuline

    Not sure if this has been requested, but in case there's time to squeeze it in for next release, would you consider implementing a simple example of where your sniper rifle snap-fades the screen to black when ADS, to swap in a 2D overlay image that would create a black vignette around the important part of the scope surrounding the reticule, and back out again?

    Mentioning since it's the traditional sniper view most games use, where what your package has is more of an AR w/ ACOG sight attached (which is cool - just wish the barrel wasn't so long and so close to the camera), but just doesn't feel like a sniper rifle without the dark vignetting of the scope.

    If you decide it's a good idea to implement, could you also have an exposed field for a sound effect that plays when the sniper rifle changes mode via ADS? :)

    Thank you!
     
  30. Deleted User

    Deleted User

    Guest

    The issue you described sounds like it's related to the weapon selection code found in PlayerWeapons.cs. The SelectWeapon() function activates the current weapon object, and deactivates all the other weapon game objects found under the FPS Player object in the prefab. If all weapons are active at once, it means that the SelectWeapon() function did not execute as intended or the weapon objects are incorrectly configured on the prefab object.

    It's interesting that the errors only occur in the standalone build and not in the editor. You might want to comment out the Unity 3.5 compatibility code in PlayerWeapons.cs as described in the previous post to rule out that as an issue first.

    You should also have a look at the changes you made to the scripts, particularly any changes to PlayerWeapons.cs and WeaponBehavior.cs, and make sure that they aren't interrupting the default scripting methods of the prefab. Would you be able to describe the specific changes you made to the default scripts and the null reference errors you're getting so we can better assist you in determining where the problem is occurring? Thank you.

    Edit: This could also happen if you started your project using Unity3.5 and disabled weapon objects under the FPS Weapon parent object of the prefab, then imported that project with the disabled weapons into Unity 4. Because of the changes made in Unity 4 to activating game objects and depreciating SetActiveRecursively, all the child weapon objects under FPS Weapons need to be enabled on import, otherwise the SetActive code used in our asset to activate the weapon objects in Unity 4 won't work. The issue is discussed in this article.

    That said, everything should still work fine if the weapon objects are enabled when importing to Unity 4. Although if this were the problem, the weapons wouldn't be working in the editor either and not just the standalone...


    Hi thedreamer, this is a feature that you could implement with some research and experimentation. We would start by creating a boolean value called something like bypassInput in FPSRigidbodyWalker.cs that is true when you want the player to be automatically moving. When bypassInput is true, the Input.GetKey (FPSPlayerComponent.moveForward) code would be skipped and inputY would manually be set to 1 to make the player move forward automatically.

    To steer the player's forward movement in a specific direction, you could bypass the mouse input code in SmoothMouseLook.cs when bypassInput is true (which looks like: rotationY += Input.GetAxisRaw("Mouse Y")) and create a keyframe animation in Unity's animation editor for the FPS Camera object which would animate the SmoothMouseLook.cs script component's rotationY value when bypassInput is true. You could then tweak the keyframes of the steering animation to get the player to move on a preset path. bypassInput could then be set to false to resume player control.

    This is a basic description of how I would go about adding the automatic player moving feature, but hopefully it gives you some ideas on how to go about this. We may even look into adding this feature at a later date, but we are currently busy adding and testing other features at the moment. Please let us know if you have any more questions.


    To have lens flares appear in the game, you should check that there is a Flare Layer on the Weapon Camera object found on the !!!FPS Main/FPS Camera/Main Camera/Weapon Camera object in the Hierarchy window. The Flare Layer needs to be on the Weapon Camera and not the Main Camera, because the Weapon Camera has a higher depth value. This discussion might also help. There isn't a Flare Layer on the Realistic FPS Prefab's weapon camera by default, but we'll change that for the next version. Thanks for pointing that out.


    Hi lod3, we'd like to implement a sniper aiming system like this. It seems like the best way to go about it would be to have the player zoom in with their sights as normal, then fade to a 2D sniper reticule overlay and disable the mesh rendering component of the weapon once the sights are up. I agree that different zoom levels are also a good idea. We would definitely have fields exposed for zoom level sound effects per weapon and the option to use the ACOG style sight versus the sniper overlay style sight. This may or may not make it into the next version, but it is on the list.
     
    Last edited by a moderator: May 25, 2013
  31. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Azuline, since it's Creative Commons, do you have links to the source weapon model files?
     
  32. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Yeah, flat-out disabling the rendering of the gun while scoped is even better. Have any estimate yet on when the next version is coming out, or what features will be included?


     
  33. Deleted User

    Deleted User

    Guest

    Most of the models are from TurboSquid, like this pack, katana, and health kit. The next version might be two or three weeks away, because some testing needs to be done on the new features. Here is an outline of the new update so far:

    Realistic FPS Prefab In-Progress Change List 5/25/2013

    -Made weapon sprinting animation return to center sooner after player starts falling
    -Unhid the mouse cursor when paused (or timescale = 0)
    -Added collider sweep in front of player to allow better jumping over stationary obstacles
    -Fixed sights not raising if sprint is cancelled, but sprint and forward buttons are still held
    -Added an extra check to make animated camera angle values return to zero when not playing animations. This prevents rare occurrences of the weapon and camera becoming misaligned.
    -Added muzzleLightDelay to WeaponBehavior.cs to define delay before muzzle light begins fading
    -Added muzzleLightReduction to WeaponBehavior.cs to define speed of muzzle light fading
    -Changed name of "childNum" var in PlayerWeapons.cs to "currentWeapon" for clarity
    -Added defaultFov var to Ironsights.cs to allow the default camera FOV to be customized
    -Added sprintFov var to Ironsights.cs to allow the camera FOV while sprinting to be customized
    -Added weaponCamFovDiff var to Ironsights.cs to allow the weapon camera FOV to be customized. This value is subtracted from the main camera FOV to control the perspective of weapon models.
    -Different footstep sounds, landing sounds, weapon impact effects, impact marks, and weapon impact sound effects, per surface
    -Moved weapon effect vars and functions from WeaponBehavior.cs to new WeaponEffects.cs script
    -Added the var myWaypointGroup to the AI.js script and added the waypointGroup var to AutoWayPoint.js script to set waypoint groups for NPC patrols
    -Fixed doPatrol behavior in AI.js so NPCs stand watch if not patrolling
    -Locked mouselook roll to prevent gun rotating with fast mouse movements
    -Player can now drop weapons with the droppable value set to true in WeaponBehavior.cs
    -Added addsToTotalWeps bool to WeaponBehavior.cs and backupWeapon int to PlayerWeapons.cs to allow player's backup weapon to be skipped in auto weapon selection during weapon drops and swaps, to make the backup weapon not be counted toward player's weapon total, and to prevent the backup weapon from being dropped.
    -The maxWeapons int in PlayerWeapons.cs now defines the maximum amount of weapons that can be held at one time
    -WeaponPickup.cs will now read its removeOnUse bool and the dropWillDupe bool in WeaponBehavior.cs to determine if the current weapon should be dropped or destroyed when picking up a new weapon
    -The player's crosshair now changes to an "X" reticle if the player can't pick up the weapon under the crosshair, such as when the player has already picked up the weapon from an armory (dropWillDupe set to true) and can't drop the weapon due to this allowing ammo duplication exploit
    -Added unique Texture2D vars to item pickup scripts to allow custom pickup reticles/icons

    Some AI fixes, swimming, and a limited sprint option are the remaining features we're planning to add for this version. This update involves more changes than the past ones have, so it's taking longer than expected. Thanks for your patience.
     
    Last edited by a moderator: May 26, 2013
  34. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    All this will come in next update? Wow, nice features, it's the best asset in the world!!!
    Maybe, if you have time you could fix this: on AK47 weapon, left hand hasn't been animated in ready animation. When you reload and while reloading switch the weapon, left hand will stay at the position when you switched the weapon, maybe you could just put so left hand moves a little and gets back in a right position. I don't know, maybe you have some better idea than that :)

    Screenshot 1: (Weapon isn't reloading, hand stays like that until I shoot or reload)
    $ScreenShot001.jpg

    Screenshot 2:
    $ScreenShot002.jpg
     
    Last edited: May 26, 2013
  35. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Awesome changelist! So... no grenades this update? :)


     
  36. Sors

    Sors

    Joined:
    May 27, 2013
    Posts:
    1
    Hi Azuline Studios! Thank you for Realistic FPS Prefab!
    When I add my model, I can not kill her
    and it does not attack me
    kind ever made, but does not work(
    help please
    thank you
     
  37. Deleted User

    Deleted User

    Guest

    Thanks Dari! Those are features/fixes that are already implemented. A few more will also be added for the next update.

    To fix the AK47 reload animation when it's interrupted by switching, you can drag the AK47_Anim's "Fire" animation from the Project Library window, to the "Animation" field of the animation component of the AK47_Anim instance located under the AK47 object that is a child of the FPS Weapons object. It's the only weapon mesh with the Animation field (unintentionally) empty and that's why the glitch only happens for the AK. You can also change the AK47 Ready and Reload animation wrap mode types to "Once" in the animation import settings and leave the Fire animation at "Clamp Forever". We overlooked this for the AK47_Anim mesh, but it will be corrected in the next update. Thanks for finding this!


    Sorry, no grenades for the upcoming update, but you can expect them in the next one after this lod3!


    Hi Sors, thank you! To set up an enemy NPC that attacks the player and can be attacked, you can create a new game object, add a Character Controller component, add an Audio Source component, add an Animation component with "idle", "run", "shoot", and "walk" animations, and add the AI.js, AIAnimation.js, CharacterDamage.js, and Gun.js scripts to your NPC from the Demo Scene Assets/AlienNPC/Scripts folder in the Project Library window. You'll also want to set your NPC's layer to layer 13, the "NPCs" layer, select the sounds for the Gun and CharacterDamage script components, and select the Dead Replacement for the CharacterDamage script component.

    This is a very basic description, but hopefully it can get you started. The Robot NPC objects in our demo scene can also be duplicated and you can swap out their character models for your own. Please let us know if you have any more questions.
     
  38. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    676
    Awesome. Did you get my PM?

     
  39. Deleted User

    Deleted User

    Guest

    Yes, just replied lod3. Hope I answered your questions.
     
  40. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    Thanks Azuline! It would also be good, if possible, to make a shotgun reload stopping if press left mouse button. Thanks :)
     
  41. TheBooBear

    TheBooBear

    Joined:
    Dec 15, 2011
    Posts:
    95
    Is there a way to reduce the fish eye effect? It is much more pronounced then the previous controller I was using.
     
  42. inglipX

    inglipX

    Joined:
    Aug 9, 2012
    Posts:
    30
    Hello, i have recently purchased your asset. It is great- its awesome. One thing though; when I am in Unity editior my player can drag rigidbody objects nicely, but when i build and run the game i am unable to drag/carry those same objects in the build. Whats the issue here?
     
  43. Deleted User

    Deleted User

    Guest

    No problem. Shotgun reloading can be interrupted in version 1.16 by holding the left mouse/fire button if there has been at least two shells loaded. Thanks for your suggestion Dari, this behavior has been updated in the new version to cancel the reload with a button press and it works a lot better.


    Hi Drunken Monkey, do you notice the fish eye effect in the whole scene as rendered by the main camera, or are there certain elements of the scene that make the fish eye effect more apparent? A previous poster had this same question and we discussed it in the last reply of this post. OneShotGG noticed the fish eye effect in the trees the most because the tree billboard distance was set close to the camera and the trees rotate on their x axis to stay parallel with the main camera angles which can create a fish eye effect.

    If you notice the fish eye effect in the whole scene, the main camera's FOV value might be too high. In the next version, there will be a customizable parameter added to the Ironsights.cs script called Default FOV that will let you directly modify the main camera's FOV value. Another feature of the Realistic FPS Prefab is a main camera FOV increase when sprinting to give the visual impression of acceleration, which might be creating the fish eye effect you notice.

    To decrease the main camera FOV in version 1.16, you can do a search for the statements in Ironsights.cs that look like this: nextFov = 75.0f; and change the 75.0f value to something smaller. To disable the sprinting FOV increase, just change Line 148 in Ironsights.cs which looks like this: nextFov = 85.0f; to your preferred default main camera FOV. Sorry for the inconvenience, but customizing the main camera FOVs will be a lot easier in the next version.


    Thanks inglipX! For the rigid body dragging issue, are the objects you are trying to pick up the default objects that are included in the demo scene, or have you created your own objects? You'll want to make sure that the objects are assigned to a layer that is included in the "Layers To Drag" layermask of the Drag Rigidbody script component attached to the FPS Player game object in the prefab. Rigid bodies that can be dragged by the player should also not be set to Is Kinematic.

    When you are trying to drag rigid bodies in the standalone, are you not able to drag any rigid bodies at all, or are you noticing the issue only when the objects are close to the player? The DragRigidbody.cs script currently won't drag objects that are in contact with the player's capsule collider. This is done to prevent the objects that are being picked up from pushing the player unrealistically. This simple work-around will be improved in the next version for pick up objects, and we plan to improve the script further with an alternate pickup method later on.

    If you are still having problems dragging rigid bodies in the standalone build, could you please provide some more information about your project, such as, have you added any code or changed any objects from their default settings in the demo scene or are you just trying to run the default scene? And when you can't pick up the rigid bodies in the standalone build, do they not respond at all when you hold down the pick up object key, or do they move unexpectedly in some other way? And are you using Unity 4 or 3.5?

    You can also experiment with changing line 26 of DragRigidbody.cs which looks like this:

    Code (csharp):
    1.         if(!Input.GetKeyDown(FPSPlayerComponent.moveObject)){
    to this:
    Code (csharp):
    1.  
    2.         if(!Input.GetKey(FPSPlayerComponent.moveObject)){
    In case there is a problem detecting the key press.

    Please let us know if you are still encountering issues dragging rigid bodies in your stand alone build. Thanks for your patience.
     
  44. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    Wow, so many features will come in next update, can't wait it! Just one question, I'm curious: sometimes, if I hold/shoot in the physic object, it goes through the mesh collider (through the house wall for example) , I think you found it out because you put box collider under the house and the spaceship.
    If you have any good tutorial about how to create a lightmap, or if you know, please tell me. :)
     
    Last edited: May 30, 2013
  45. TheBooBear

    TheBooBear

    Joined:
    Dec 15, 2011
    Posts:
    95


    I give it a try and let you know.

    fyi, here is an example of it. https://dl.dropboxusercontent.com/u/22859160/Zombies/Web.html
     
  46. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    Hello, Drunken Monkey, have you created the city model in "Zombie" game or you download it from internet?
    If you downloaded it, can you tell me the link, please? :)
     
  47. TheBooBear

    TheBooBear

    Joined:
    Dec 15, 2011
    Posts:
    95
  48. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    Thanks alot!!! It works, it normally costs $3, but if you write them a Newsletter, you get it for free! It's pretty good. (you get rain and raindrops particle systems, rain sound, city...) :)
    How do I put something on UnityWebPlayer so other can see it?
    Thanks.
     
    Last edited: May 31, 2013
  49. Deleted User

    Deleted User

    Guest

    Nice Demo! Really fun to run around the streets and buildings. The camera FOV increase while sprinting might be causing the fish eye effect you mentioned. Experimenting with the FOV code in Ironsights.cs could be a good place to start for removing or reducing it.


    Thanks Dari, the objects going through the wall of the house does happen sometimes and it's due to the physics engine not catching a collision between fixed updates. You can try setting the Physics.minPenetrationForPenalty = 0.001f; line in FPSPlayer.cs to a lower value and it might help. You can also try decreasing the force of the weapons in their Weapon Behavior components so light objects like the cans don't get pushed as far when they are fired at.

    Here is a good page about lightmapping. You basically just set any objects you want to cast a shadow as static and then click on the Bake Scene button in the Lightmapping window. It usually takes a while to render the lightmaps.

    To share a web player you can use Dropbox. Here is some discussion on the subject and how to enable the public folder for new accounts. The exported webplayer html file needs to be updated with the public Dropbox link to the uploaded .unity3d web player file as well. Hope that helps.
     
  50. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    The exactly same thing happens to me, I'll try to do what have you answered. I have no idea why, but when I switch weapons the ready animation plays and I can zoom while it is playing, I'll be glad if you tell me how to fix that. :)
     
    Last edited: Jun 2, 2013