Search Unity

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:
    12,697
    Make sure you import the model's Rig as Legacy. If the animation clips are separate FBX files, import them as Legacy also.

    When you import the Rig as Legacy, it will automatically add an Animation component to your model and remove the Animator component. You may need to add the renamed clips back to the Animation component's animation list.

    Then select your model in the Scene view. Open the Animation window. Select each animation clip and play it. Make sure the animation looks correct in the Scene view. Don't worry about the Realistic FPS Prefab components until you've done this.
     
  2. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    So i have 2 model of Zombie :

    I have FBX Model with just rig:

    $fbx.jpg

    And i have Zombie prefab with animator controller :

    $prefa.jpg

    All animation zombie is that on the animator view :

    $Desktop 16-05-2014 23-08-00-246.jpg

    And i have import a FBX model of my ZombieGirl and them as Legacy and nothing again :/

    Picture of zombie component:

    $Desktop 16-05-2014 23-07-28-204.jpg
     
  3. StanleyDrunk333

    StanleyDrunk333

    Joined:
    May 17, 2014
    Posts:
    6
    Hello Azuline,
    Incidentally I first time in the forum and I am Users Asset It
    So I'm Asking Questions:
    I Enter Exit Vehicle Problems in Prefab Player
    Genesis I Accidentally Script on Camera,
    No Responses suddenly appear continuously camera weapon if already entered vehicle,
    For That I Include Pictures and Asset, For Fixing
    If It Please Share Results In Fix Here Yes
    I Need
    $A.png
    $b.png
    $C.png

    Link Download Please Fix , I No Include Prefab:
    http://www.mediafire.com/download/vp7trxeffs3p6k3/Vehicle+Physics+With+Enter+&+Exit+4.3.rar
     

    Attached Files:

    • $C_A.png
      $C_A.png
      File size:
      17.5 KB
      Views:
      993
    • $D.png
      $D.png
      File size:
      434.4 KB
      Views:
      1,048
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Let's focus on the ZombieGirl because she uses the legacy Animation component. (You cannot use the Mecanim Animator component with Realistic FPS Prefab's AI script.)

    1. Select the ZombieNPC object in the Hierarchy. This is the object that uses the ZombieGirl model.
    2. Open the Animation window (Window > Animation).
    2a. Move the Animation window so you can also see the ZombieNPC object in the Scene view.
    2b. In the Animation window, select "idle".
    2c. In the Animation window, press the Play button.
    2d. Is the ZombieNPC in the Scene view correctly playing the idle animation?​
     
  5. StanleyDrunk333

    StanleyDrunk333

    Joined:
    May 17, 2014
    Posts:
    6
    Please Show Pictures Steps, All People In Do not Understand
     
  6. KingofMk98

    KingofMk98

    Joined:
    Oct 10, 2013
    Posts:
    63
    not to come off as rude but not everyone has the time to just sit here and make a full tutorial. His "paragraph" is easy enough to understand.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Thanks, KingofMk98. Guys, please be aware that this isn't my product. I hope Azuline gets a chance to jump in soon. That said, I like to see things through, and I know several Realistic FPS Prefab users also use the Dialogue System, so here's a screenshot:

    $rfps.jpg

    1. Make sure your NPC has an Animation component with clips named walk, run, idle, shoot, and die.

    2. Select the NPC in the scene.

    3. Open the Animation window and play idle.

    If the steps above work, then your NPC should work with the AI script.

    4. Buy the Dialogue System and add conversations and quests to your Realistic FPS Prefab game. ;-)
     
  8. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Ok i understand :)

    So for my zombiegirl she don't move and all is red (look picture) and i have test with zombieNPC and idle animation play.

    $mini_179508Desktop17052014103920127.jpg

    Help :(
     

    Attached Files:

    Last edited: May 17, 2014
  9. Deleted User

    Deleted User

    Guest

    Good to hear you solved the slope limit issue Takahama. Sometimes when there is a problem that is hard to figure out or seems random, one thing to try is importing the Realistic FPS Prefab into a blank, empty project, and then importing your other packages one at a time to determine if there is a conflict between assets.

    About using the slope limit for a Character Controller with our project, the Realistic FPS Prefab uses a custom rigidbody character controller which doesn't access any of the default Character Controller functions, but you can access the actual slope limit value of a character controller and pass it to the RigidBodyFPSWalker.cs script, if that's what you mean. We're always seeking to improve our project, so if you run into anything that seems like a bug, or something that could work better, please let us know as it helps us improve the asset.

    As for multiplayer, we haven't done a lot of testing yet, but we've been communicating with some other developers that are starting their own projects with networking features. This is definitely something we'd like to look into in the future, as we are currently laying the groundwork with some other improvements.


    Hi javier11om, the reason the weapon object is duplicated in the video is to make setup easier for the new weapon. You could set up your new weapon from scratch, but it's not really necessary since you can edit the parameters of the WeaponBehavior.cs script in the inspector. If you're asking about making your own weapon models rather than working with the existing ones, please do. This is actually how we intended to set up the weapon system. You can do this by deleting the existing MyWeapon_Anim mesh object and dragging your own model with animations from the Project Library over the duplicated weapon object. You can then rename the parent of the weapon mesh to the name of your new weapon, like the other weapon objects.

    Your new mesh object would also need to be dragged over the Weapon Mesh field of the WeaponBehavior.cs component, so the scripts know which mesh to position in FPS view and play animations on. Your new weapon mesh object also needs to be set to layer 8, the Gun layer. That, and some repositioning of the new model should be all you need to do to add new weapon meshes.

    It might be hard to follow the steps by text, but we are planning to make a new video that shows the different ways new weapons can be added, either by completely replacing the weapon mesh with your own like you asked, or by swapping out a parts of the existing mesh with a non-animated weapon, attachment, or hand model, and using the original animations. Hope that helps.


    No problem AndySum, exposing the lerp speed of the player movement inputs in the inspector is a good idea and would allow developers to customize the feel of player movement to their preference. Thanks for your feedback.


    Hi Infiniteno, adding an inventory system should be fairly straightforward, as there are several variables in our scripts such as ammo, health, and weapon equip states that could interface with an inventory system. Devguy has created an inventory system that he is offering as well. As far as implementing your own inventory system, you might want to start by familiarizing yourself with our scripts, mainly the item pickup, PlayerWeapons.cs, and FPSPlayer.cs scripts which handle most of the health, ammo, and weapon amounts. We also plan to add our own inventory system in a future update, once some more gameplay features are finished. Thanks for your patience.


    Thanks ShinfoK, we'll have a look at your project. Sometimes this is the easiest way for us to see what might be happening in your scene setup.


    Glad you guys figured this out. We'll also double check to see if we can prevent any other possible asset reference errors like this.


    Hi blueLED, this is a known bug that will be fixed in the next version. The distorted sound happens because the FPSRigidBodyWalker.cs script is trying to play the sound more than once. If you need a fix right away, feel free to send us a PM or email and we can give you the updated code.


    Nice job TonyLi, the Dialogue System looks great! We'll definitely be following your progress on this. We still remember the faction AI suggestions we talked about a while ago, and plan to implement them with some other AI improvements soon :)


    Thanks Antiker90, you might want to look at this post and download the TagManager.asset file so your layers and tags will be correct. Then set your buildings to layer 10, the World Collision layer as ShinfoK mentioned, with a tag of Dirt, Metal, or Wood for impact effects. Hope that helps.


    We'll have a look at your project StanleyDrunk333. There might be some customization of the scripts needed to get the vehicle behavior working. A good start would be to look at the platform and optional weapon hiding (when on ladders and under water) features. In addition, the player's control input needs to be bypassed and used to control the vehicle.

    A simpler solution might be to deactivate the player prefab altogether when in a vehicle, and then repositioning the prefab and activating it again when exiting the vehicle. We haven't done a lot of testing with activation and deactivation of our prefab yet, but it is on our list to add full compatibility for this in a future update. Thanks for your patience.


    TonyLi, thank you very much for helping Defcon44 with the NPC model issue. We've been very busy lately working on the next update Defcon44, so we haven't had a chance to go over your posts yet, sorry about that. At first glance, this seems like it could be an issue with the legacy animations used in the NPC AI scripts. Character model set up for the NPCs depend a lot on how its object hierarchy has been rigged and exported from the 3D app.

    Your most recent screenshot shows that you are using the Animation component, and not the Animator component, so that isn't the problem since our current AI scripts play legacy animations using the Animation component. The fact that your animations in the Animation window for the zombie model are red seems to point to a conflict or misconfiguration of the mesh or animations. Do any of the animations beside "idle" play when you press the arrow button in the Animation window? Also, are there any errors in the console related to this model? A video or archive of your project might be useful for us to help you resolve this issue.
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    This certainly looks to be the case. Defcon44, in the Legacy animation system, animation clips only work on the models they were built for. You can't play a different model's animation clip on ZombieGirl. (Technically it's the skeleton, not the model itself, but I'm trying to keep it simple.)
     
  11. Antiker90

    Antiker90

    Joined:
    Oct 2, 2013
    Posts:
    22
    This with the building and the healthsystem dosent work...
    i have only a cube fore testing and this script at the moment:

     
  12. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Yes i know that, all animation on the zombiegirl is animation of this model :)

    Yes i use animation component because with the zombie pack i have animator controler but in game with animator component zombie don't player animation, zombie attact me but play just idle animation :(

    I don't have error on the console for the model.
     
    Last edited: May 17, 2014
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Okay, we were just making sure that the model and animations were compatible first.

    1. Please double-check that the "walk", "run", and "shoot" animations also play correctly in the Animation window.

    2. If they all play correctly, then verify they are named exactly:
    • idle
    • walk
    • run
    • shoot
    All in lowercase.
    • Correct: run
    • Incorrect: Run
    Verify that there are no blank spaces (" ") before or after the clip name.
     
  14. LAUDSOFT

    LAUDSOFT

    Joined:
    Jan 5, 2014
    Posts:
    102
    That's what I suspected -- repeated triggering of the sound effect. I think I will wait for the next update before tinkering with it anymore. Sorry if it's been asked and answered somewhere else, but could I ask for a rough ETA on the next update? Middle of June maybe? Just curious, it's not urgent.
     
  15. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    In the animation windows my zombiegirl all is red and she don't play any animation. BUT the version of zombie girl with animation controler play animation.

    After in the " preview windows " in the right corner of unity after selected a animation, animation play YES.

    All animation are named with :

    idel
    walk
    run
    shoot

    no space or character.

    What is Lowercraft ? :/
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Okay, there's your problem. If she doesn't play animations when you use the Animation window, then she won't play them in the game.

    Please be precise. Are you talking about an Animator Controller? If so, this is a Mecanim component. It means that you probably imported the ZombieGirl model's Rig as Humanoid. You must import it as Legacy.

    This doesn't matter. The Preview window will play correctly in Legacy or Mecanim. Make sure it plays correctly in the Animation window.

    Check the "idle" animation again. It must be spelled "idle".


    Lowercase means a, b, c, d, e...
    Uppercase means A, B, C, D, E...

    Sorry about the language difficulties. Believe me -- it would be much worse if I were trying to write my part en français.... :)
     
  17. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Ok so i use the model of zombiegirl LEGACY and not humanoid.
    With this model animator controler don't work.

    Name of animation:

    idle
    walk
    shoot
    run
    die

    And on the animation windows she don't play any animation and on the scene to.

    Is ok for the language ;) I trust you about votre français ^^
     
  18. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Thank you, Azuline. Very much appreciated.
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    The Animator Controller is only for Mecanim. Ignore it.

    If the animations are separate files (not contained in ZombieGirl.fbx), they must be built for ZombieGirl's skeleton. Otherwise they will not play in the Legacy system.

    They will still play in the Mecanim system because Mecanim can retarget animations to different skeletons. But Realistic FPS Prefab's AI script does not support Mecanim, so you can't use this.

    To check, add ZombieGirl.fbx and idle.fbx to the scene. Then expand both the hierarchies of both objects. The hierarchies must match.

    In the example below, they do not match:

    ZombieGirl
    Hips
    LowerLeg
    UpperLeg
    Spine
    Neck​

    idle
    Hips
    LeftThigh
    RightThigh
    Spine1
    Spine2​

    This means you can't play "idle" on ZombieGirl.

    If you are certain that they are built for ZombieGirl's skeleton, ensure they are also imported as Legacy.
     
  20. GentleForge

    GentleForge

    Joined:
    Sep 7, 2013
    Posts:
    29
    If i transfer all Scripts (FPSRigidBodyWalker, Footsteps...) from the "!!!FPS Player" Prefab to the Root Prefab, i have issues with the Player and Camera Rotation.

    Players Y-Axe Rotation is at: 310
    Camera Y-Axe Rotation is at: 100

    How to set the Camera Rotation to the Players Rotation?
    It seems that this part at the FPSRigidBodyWalker:

    doesnt work anymore. Someone can help?
     
  21. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Ok but i don't have idle.fbx

    I just have file animation of the animation.

    And how i can check animation is importing as legacy ?
     
  22. StanleyDrunk333

    StanleyDrunk333

    Joined:
    May 17, 2014
    Posts:
    6
    Hello,Azuline
    Can I ask AllWeapons + Hand File Format MB / Maya For Edit? I User Maya 2011, If There's Share In Email
    babstanley95@gmail.com
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Since it's already in .anim format, you don't have to import it.

    Did this animation come with ZombieGirl? If it did not, then it probably does not use the same skeleton, and it will not play on ZombieGirl in Legacy mode.
     
  24. GentleForge

    GentleForge

    Joined:
    Sep 7, 2013
    Posts:
    29
    Will there be any Updates (like 3rd person) or is this project death?
     
  25. Allsaveone

    Allsaveone

    Joined:
    Jan 22, 2013
    Posts:
    8
    Hello,Azuline
    Thanks for this great pack, so far ive been able to tailor it perfectly to my needs, but i have one problem i was hoping you could help with. i need the camera to be a child of the player character for networking purposes, and when i add the camera prefab as a a child of the character the camera behaviours get very strange, im not sure whats causing this. the world recenter script perhaps...
    your thoughts would be greatly appreciated, thanks again!
     
  26. GentleForge

    GentleForge

    Joined:
    Sep 7, 2013
    Posts:
    29
    I have the same problem, it seems that the tempEulerAngles doesnt work in FPSRigidBodyWalker.cs..

    Edit:
    Solution:
    Comment line 858 and 859, to disable the localEulerAngles. This fix the failing rotation of the player.
    Azuline are there better methods?
     
    Last edited: May 19, 2014
  27. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    I know what character pack he's using, I have it too. I'll try to set it up with the RFPS AI and explain how to get it working when I have a bit more time.
     
  28. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Sorry, i don't have a time for reply.

    The zombie pack have : FBX MODEL (No animator controler just model)
    PREFAB MODEL (With animator controler)
    Animation folder (many anim in)

    So yes i thinck dis is for all model pack :)

    Thanck's
     
    Last edited: May 21, 2014
  29. Allsaveone

    Allsaveone

    Joined:
    Jan 22, 2013
    Posts:
    8
    Hey guys, has anyone tryed networking this asset with Photon Unity Networking? ive just started networking this package, so far so good! but i have an issue with the collision detection for players. i simply cannot hit any other players, the shots pass right through, regardless of tag etc. any thoughts would be appreciated.
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Make sure you use the FBX MODEL and import it as Legacy. Hopefully ShinfoK will have some time to test this out with the same character pack and let us know what the deal is. (Thanks, ShinfoK!)
     
  31. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
  32. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Bump for this, about to start working with PUN, (haven't started yet), and whatever you run into, would be great to hear the solutions to.
     
  33. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Ok big thanck's :D
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Looks great! What GUI system are you using?
     
  35. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Alright, having a play with it now.

    Thanks :) NGUI, but thinking of moving to DF. The image is a mockup, in terms of graphics, I already have the majority of that (sans armour/crafting/loot crate windows) with different graphics working in game: http://i.imgur.com/KLZoYMT.png

    Also adding in a scoring system and classes (my game is sort of DayZ meets Borderlands, meets TF2).
     
    Last edited: May 21, 2014
  36. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Okay it seems I'm having trouble with this ZombieGirl, as well.

    I wrote this out as I was doing it, so it reads as an instructional... but as proven, I'm not clever enough to make this work haha.

    Code (csharp):
    1. Drop ZombieGirl into your scene.
    2. Remove Animator and Locomotion script.
    3. Drop ZombieNPC from RFPS Prefab AI folder into scene.
    4. Right click on each component attached, Copy Component, and one by one "Paste Component As New" onto ZombieGirl.
    5. Your ZombieGirl in your hierachy should now have the following components attached to the Parent game object:
    6. - Animation
    7. - Character Controller
    8. - AI (Script)
    9. - NPCAttack (Script)
    10. - Audio Source
    11. - Character Damage (Script)
    12.  
    13. Go into your ZombieCharacters > Animations > Zombies folder.
    14. Drag the animations into the "Animation" component, for example.
    15. Drag 'walk' onto 'Element 0', 'run' onto 'Element 1', etc.
    16. Ctrl+D 'attack' animation and 'death' animation. Rename these as 'shoot' and 'die'.
    17. Drag these onto the shoot and die elements.
    18.  
    19. Change ZombieGirl tag to "Flesh" and Layer to "NPCs"
    20. Under AI (Script), change Search Mask to "World Collision" and "Player".
    The model stands in a T pose, does not move or animate. The death script does work, however.

    The model has your standard bone structure, being a Mixamo character. Hmm, I'll have to look into this more.

    Edit: Definitely an issue with the animations. Dropping the ZombieGirl meshes into ZombieNPC gameobject, everything works fine (as in, it moves and attacks in a T-Pose), just doesn't utilize the animations. Changing the animations to the ones mentioned above, and it doesn't move at all.
     
    Last edited: May 21, 2014
  37. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Thanck's for your help :)

    So with that :
    Zombiegirl don't move or attack me :/

    And with that :
    Zombiegirl move but yes on T pose :(
     
  38. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    I've tried the ZombieGirl model with ShooterAI as well, and it causes Unity to crash. I'm going to go out on a limb here and suggest there's something pretty screwy with these Mixamo models for them to not work in several different instances. They are mecanim enabled so I'm really at a loss for what is causing the issue with my limited knowledge.

    I should mention, Shooter AI doesn't use their animations at all, is all IK based, utilizing rigidbody (I'm pretending to know what all this means). So it's not just the animations that are not working in this pack.
     
    Last edited: May 23, 2014
  39. S-P-A-C-E-D

    S-P-A-C-E-D

    Joined:
    Jan 11, 2014
    Posts:
    45
    Never mind on all of it.

    Got head shots working by putting a capsule collider on his head and attaching the character damage script to the head. Then I made it destroy the transform.root of the gameObject, instead of the transform of the collider.
     
    Last edited: May 23, 2014
  40. bonkorama

    bonkorama

    Joined:
    Jun 20, 2013
    Posts:
    7
    Hello All! This is my first post to this thread, and I just want to say what a great kit Realistic FPS is. It really saved my butt...

    Setup: Ive replaced my NPC Zombies Mesh's and textures and animations with NEW meshes, textures and animations.
    The New Zombies follow and attack the player and use the new "walk", "run", "idle", "shoot" animations embeded ( which are different than the ones in the original prefabs for the Include Characters ) but NOT the "die" (another question about that later).

    Problem #1: Upon dieing my NEW ZOMBIE'S mesh turn to the STANDARD zombie ragdoll with its standard texture ( the original zombie included with FPS kit).

    Question #1: Do i need to make a new ragdoll for EACH of my NEW ZOMBIES to drag into the damaged scripts public variable? Is there another solution?

    Thanks in advance.
    Bonk. :confused:
     
    Last edited: May 24, 2014
  41. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Yes, create a Ragdoll of your model. Add the Remove Body script to that ragdoll and create a prefab for it.
    Then in your actual zombie prefab, go to "Character Damage" script and drag your new ragdoll prefab into the "Dead Replacement" section.
     
  42. bonkorama

    bonkorama

    Joined:
    Jun 20, 2013
    Posts:
    7
    Thanks Shin, that was super fast. :D

    Bonk.
     
  43. bonkorama

    bonkorama

    Joined:
    Jun 20, 2013
    Posts:
    7
    Question #2: In the embedded animations for my mesh, is a "die" (actually there are several, but one is simply fantastic!) animation.
    Ive tried unsuccessfully to use it, INSTEAD of the ragdoll end to my character. Any advice on where to look to enable this if it has already been implemented?

    Bonk. :mrgreen:
     
  44. S-P-A-C-E-D

    S-P-A-C-E-D

    Joined:
    Jan 11, 2014
    Posts:
    45
    Yes, you do if you want it to be believable. It's not really difficult.
     
  45. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    You could perhaps modify the code to delay the prefab switching. I wouldn't really know how to do this, someone else might help with that, but look at the character damage script and google a little.
     
  46. Reiner

    Reiner

    Joined:
    Dec 2, 2012
    Posts:
    214
    Any Updates Plant in near Future for the Kit? The last update already few days/month ago?
     
  47. Deleted User

    Deleted User

    Guest

    Mid-June sounds like a good estimate, blueLED. We're working on prone stance as the last feature of this update, then after some testing, it should be ready.


    Hi GentleForge and Allsaveone, this is probably happening because the scripts expect the default hierarchy of the prefab objects. The code GentleForge mentioned involves synchronizing the FPS Player and FPS Camera object angles. Since you want to combine the two objects, the mouse look input will need to be applied to the FPS Player object rotation, instead of the FPS Camera object. We haven't tried doing this, but if you are familiar with the scripts, it should be possible with some modifications. Please let us know if you have any more questions.


    You're right about disabling the angle synchronizing code we mentioned earlier, GentleForge. If you're going to have the camera as a child of the player object, this code can be commented out/removed, but the mouse look script will need to rotate the player prefab and control the camera pitch. The reason the prefab isn't set up like this by default is that the camera will inherit the player object's position at the FixedUpdate() speed (since it is a physics object) instead of being smoothed/lerped to the player controller object's position. Hope that helps.


    Hi Allsaveone, by default the WeaponBehavior.cs script checks certain layers for weapon hits, like NPCs, world collision, and physics objects, but not other player objects. The NPCs are able to damage the player because in their damage check in the NPCAttack.cs script around line 162, they have a case for layer 11, the Player layer, which calls the ApplyDamage() function of FPSPlayer.cs to damage the player. The code looks like this:

    Code (csharp):
    1.                         if(hit.collider.gameObject.GetComponent<FPSPlayer>()){
    2.                             hit.collider.gameObject.GetComponent<FPSPlayer>().ApplyDamage(damageAmt);
    3.                         }    
    A similar case can be added to the WeaponBehavior.cs script around line 948 of WeaponBehavior.cs so players can attack other players. The origin of the weapon raycast might need to be moved forward a bit so the weapons won't hit their own player collider. This is somewhat of a basic explanation, but hopefully it will give you some ideas.


    Nice inventory GUI ShinFok, keep up the great work!


    We'll need to do some more testing and update our scripts in a future version to better animate the wide variety of character model setups available. For now, they will have to use legacy animations, but we'll soon be moving over to newer versions of Unity and better incorporating features like Mecanim and Shuriken. Thanks for your patience, Defcon44.


    Hi bonkorama, good to hear you're enjoying the asset! The current AI scripts replace the animated character model with the Dead Replacement reference of the CharacterDamage.cs script component like ShinfoK described. This object reference could be anything, but rigged ragdoll versions of the animated models are used for the default NPCs. You can use an instance of your character mesh without a ragdoll, that plays a death animation automatically by checking the Play Automatically button on its Animation component.

    If you want to have ragdolls for each of your zombies, you can use an existing ragdoll setup, or you can create you own by adding character joints to the NPC's skeleton and tweaking the mass and angle parameters. Once you've set up the ragdoll for your character model, you can drag its object reference from the Project Library to the Dead Replacement field of the CharacterDamage.cs component of the NPC. After doing this, the ragdoll should spawn in the animated character mesh's place when the NPC dies.

    A better way of doing this would involve using Mecanim and activating the character joints on the model when the NPC dies instead of swapping/instantiating NPC objects. This would also allow precise hit detection because there would be colliders attached to the bones of the NPC model, which could send an ApplyDamage() message to the NPC prefab when hit by weapons.


    Hi Reiner, we are almost finished with the next update. Here is a preview web player demo you can try:


    Improvements to note in this demo:

    • You should be able to control the character with both mouse + WASD and an Xbox 360 gamepad.
    • The player can lean using the Q and E keys.
    • A new soldier NPC that fires burst shots.
    • Zones that damage the player (the fires at the end of the level).
    • 3 shot burst mode for weapons (can be tested with the MP5).
    • New pain texture display for player damage.
    This update will include a few more back-end fixes, like improvements to jumping and crouching and better handling of GetComponent and GUI calls. Most of the work has involved the input re-write, with the controls now being fully integrated with Unity's Input Manager and localized in one script.
     
  48. KingofMk98

    KingofMk98

    Joined:
    Oct 10, 2013
    Posts:
    63
    Awesome update
     
  49. snowcult

    snowcult

    Joined:
    Feb 6, 2014
    Posts:
    295
    Very excited for the next RFPS update! :)

    Edit: Request if you manage to have any time. A "zoom" for sniper (which we could also use for Binoculars and/or rangefinders), for example, middle mouse would zoom the scope in a little more than already set.
     
    Last edited: May 27, 2014
  50. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    169
    Really nice update Azuline Studios! i like everything :D but i have a one question :l
    its possible to Aliens, Zombies and Soldiers. They can attack each other ? its will be awesome!
    Thanks ^^

    Edit : And please :( make enemies can hear our gun shots! (And a silencer option will be awesome!)

    Finally Edit button worked :')
     
    Last edited: May 29, 2014