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
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Realistic FPS Prefab [RELEASED]

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

  1. Ludo97

    Ludo97

    Joined:
    Dec 9, 2015
    Posts:
    121
    Hello , I add text ( canvas) but I would still do I start the games: my text appears smooth as the other texts (health , hunger, thirst ) thank you in advance
     
  2. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    196
    ...and...dispear ye not, RFPS users, and let's contribute here, so we can all benefit
    better from future RFPS adventures, so in that light - here i start with a bit contrib:
    i've just heard back from friends in Azuline team,
    that: vehicles ARE definitely on the map, and their integration (such as with cool
    vehicles packages out there, and RCC Car Controller, as well) :)
    I have also notified Azuline that in RCC - the car cameras are (still)
    going through the walls, so (probably at that time_ - they can request RCC to
    fix that first, before Azuline moves to integration of cool RCC package with RFPS ...
    BTW, just noticed that RFPS has added a nice bow weapon (hello FarCry 4 !).
    :)
     
  3. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    196
    umm...first - check what font is selected in other gui text you already like onscreen,
    and try choosing that same font, (in font mesh renderer entry in Inspector)...
    ***and, guys, please, make available here, anything (scripts, gizmos, etc) you've made,
    and it works ok with new RFPS, just as i do, you never know may be needing,
    or looking at them !).
     
    Last edited: May 8, 2016
  4. SteveRyu

    SteveRyu

    Joined:
    Apr 9, 2014
    Posts:
    121

    Is there someone who having this strange one?
     
  5. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    I found that this happened when I done the settings for the weapon and copied and pasted the settings to the hierarchy after I stop scene.
    I fixed this by using printscreen and re-entering them manually, I'm not sure what causes this issue. If i;m correct the issue is the fire animation not playing correctly? and on a weird pivot
     
  6. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Hi, I have no idea about animations but wanted to add so in 3rd person when aiming it played the other idle animation and whn I fire it plays the shootfp animation. I've looked over most scripts but can't where it uses shootfp.

    This is what I have so far but it doesn't seem to work, like I said I have no idea about animations or timings. I placed this on VisibleBody script and under the Third Person Section. line 451

    Code (CSharp):
    1. ///////////////////////////////////
    2.  
    3.  
    4.                
    5. if (FPSPlayerComponent.zoomed) {
    6.                         modelRightMod = Mathf.Lerp (modelRightMod, idleRight, Time.smoothDeltaTime * 7.0f);
    7.                         rotAngleAmt = Mathf.MoveTowards (rotAngleAmt, idleAngle, 4.0f);
    8.                         modelUpAmt = Mathf.MoveTowards (modelUpAmt, modelUp, Time.smoothDeltaTime * 2.0f);
    9.                         AnimationComponent.CrossFade ("idle", 0.4f);
    10.                         AnimationComponentShadow.CrossFade ("idle", 0.4f);
    11.                         Debug.Log ("Zomming");
    12.                     } else {
    13.                         modelRightMod = Mathf.Lerp(modelRightMod, idleRight, Time.smoothDeltaTime * 7.0f);
    14.                         rotAngleAmt = Mathf.MoveTowards(rotAngleAmt, idleAngle, 4.0f);
    15.                         modelUpAmt = Mathf.MoveTowards(modelUpAmt, modelUp, Time.smoothDeltaTime * 2.0f);
    16.                         AnimationComponent.CrossFade("idle2", 0.4f);
    17.                         AnimationComponentShadow.CrossFade("idle2", 0.4f);
    18.                         Debug.Log ("UnZomming");
    19.                     }
    20.  
    21.                     if (InputComponent.firePress) {
    22.                         modelRightMod = Mathf.Lerp (modelRightMod, idleRight, Time.smoothDeltaTime * 7.0f);
    23.                         rotAngleAmt = Mathf.MoveTowards (rotAngleAmt, idleAngle, 4.0f);
    24.                         modelUpAmt = Mathf.MoveTowards (modelUpAmt, modelUp, Time.smoothDeltaTime * 2.0f);
    25.                         AnimationComponent.CrossFade ("shootfp", 0.4f);
    26.                         AnimationComponentShadow.CrossFade ("shootfp", 0.4f);
    27.                         Debug.Log ("Zomming and Firing");
    28.                     } else {
    29.                         modelRightMod = Mathf.Lerp(modelRightMod, idleRight, Time.smoothDeltaTime * 7.0f);
    30.                         rotAngleAmt = Mathf.MoveTowards(rotAngleAmt, idleAngle, 4.0f);
    31.                         modelUpAmt = Mathf.MoveTowards(modelUpAmt, modelUp, Time.smoothDeltaTime * 2.0f);
    32.                         AnimationComponent.CrossFade("idle", 0.4f);
    33.                         AnimationComponentShadow.CrossFade("idle", 0.4f);
    34.                         Debug.Log ("Zomming ready to fire");
    35.                     }
    36.  
    37.  
    38.                     ////////////////////////////////////
    edit, updated with debugs, seems to work but its not playing animations

    edit I made it work :D
    add to line 625; This works for idle shooting only, will prob need to add other animations for walk aiming and run aiming. I'll do this next.
    and Good thing only will aim if you have a weapon.

    Code (CSharp):
    1. if (FPSPlayerComponent.zoomed) {
    2.                                     modelRightMod = Mathf.Lerp (modelRightMod, idleRight, Time.smoothDeltaTime * 7.0f);
    3.                                     rotAngleAmt = Mathf.MoveTowards (rotAngleAmt, idleAngle, 4.0f);
    4.                                     modelUpAmt = Mathf.MoveTowards (modelUpAmt, modelUp, Time.smoothDeltaTime * 2.0f);
    5.                                     AnimationComponent.CrossFade ("idle", 0.4f);
    6.                                     AnimationComponentShadow.CrossFade ("idle", 0.4f);
    7.                                 }
    8.                                 if (FPSPlayerComponent.WeaponBehaviorComponent.shooting) {
    9.                                     modelRightMod = Mathf.Lerp (modelRightMod, idleRight, Time.smoothDeltaTime * 7.0f);
    10.                                     rotAngleAmt = Mathf.MoveTowards (rotAngleAmt, idleAngle, 4.0f);
    11.                                     modelUpAmt = Mathf.MoveTowards (modelUpAmt, modelUp, Time.smoothDeltaTime * 2.0f);
    12.                                     AnimationComponent.CrossFade ("shootfp", 0.2f);
    13.                                     AnimationComponentShadow.CrossFade ("shootfp", 0.2f);
    14. }
    15. RELOAD//
    16. if (IronsightsComponent.reloading) {
    17.                                     modelRightMod = Mathf.Lerp (modelRightMod, idleRight, Time.smoothDeltaTime * 7.0f);
    18.                                     rotAngleAmt = Mathf.MoveTowards (rotAngleAmt, idleAngle, 4.0f);
    19.                                     modelUpAmt = Mathf.MoveTowards (modelUpAmt, modelUp, Time.smoothDeltaTime * 2.0f);
    20.                                     AnimationComponent.CrossFade ("reload", 0.2f);
    21.                                     AnimationComponentShadow.CrossFade ("reload", 0.2f);
    22.                                
    23.                                 }
     
    Last edited: May 8, 2016
  7. SteveRyu

    SteveRyu

    Joined:
    Apr 9, 2014
    Posts:
    121
    Yes you're correct, the fire animation not playing correctly...
     
  8. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hey !

    I have a big FPS problem since the last update of RFPS ... in every level my FPS drop :/

    I have touch anything in the levels, only make the update of RFPS ... any idea ?

    Thanks
     
  9. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    271
    Hi,

    I've been testing out your asset in a side project but can't seem to get started. I dragged the FPS Main object into the scene, but the camera doesn't seem to be configured, and I can actually see the player model (visible body version, without arms and head) moving around in front of the stationary camera. (See image) :eek:

    Also, I get these errors:

    "Invalid editor window UnityEditor.FallbackEditorWindow
    UnityEditor.EditorApplicationLayout:FinalizePlaymodeLayout()"

    and:

    "There are 2 audio listeners in the scene. Please ensure there is always exactly one audio listener in the scene." This error appears immediately, about 500 times.

    The demo scenes work properly, but I also get a few errors:

    "The referenced script on this Behaviour is missing!" There are other similar errors related to water planes.

    Also (though I think this is already known to be fair) the character shadows don't match up with the weapons that the character is holding.

    Hopefully I missed something simple, sorry for my noobness. :rolleyes:

    EDIT: Solved. Still had the default "Main Camera" in my scene, which obviously causes conflict with the fps cam. I still get that "invalid editor" error though.
     

    Attached Files:

    Last edited: May 9, 2016
  10. Defcon44

    Defcon44

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

    For my FPS problem, i think i have found the source (some pickup), but now, i have a new problem with the 1.23 and xbox one controller :

    All button works good but when i shoot with the right trigger the player change the weapon or the gun shoot, it is once on two.

    This is really weird because my next / previous weapons input don't have any "joystick button" :/

    Any idea please ?

    Thanks
     
  11. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    hi,

    i am interested to buy this asset but i would like to know first if it should be difficult to implement an inventory system(i actually have (Ultimate inventory & crafting Pro 5) ? or another survival like inventory.Thanks
     
  12. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    271
    I think you can use it with S-Inventory & Dialogue System.
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,388
    Yup, the documentation is here: RFPS - S-Inventory integration.
     
    OZAV likes this.
  14. Takahama

    Takahama

    Joined:
    Feb 18, 2014
    Posts:
    166
    GAME BREAKING ERROR!
    in ANY scene without "FPS Main" animations, particles are not moving! only audio keeps playing. its like in demo scene. you pause it but ambient sound is still playing.. Exact same thing! HELP!
     
  15. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    196
    In every (older) scene, you must refresh your Player prefab often:
    try this: make sure your FPS Main player obj is how you want it, than apply
    its settings to it's prefab first.
    Now - delete your FPS Main player from the scene. Now: pull it into the
    scene again, from it;s prefab. This often helps a lot with performance,
    (with Player object, and with many other objects in the scenes can be used
    the same trick, and - more often - the better ...).
    ALSO: more often you start new fresh scenes, you will be better off:
    less rubbish around left in the scenes, as our memory forgets many objects around :)
     
    Defcon44 likes this.
  16. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Thanks i go test this :)
     
  17. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hey,

    Any one have a link for the Azuline tutorial about " add NPC & Player damage for new AI System " ?

    I don't know where i can found the tuto :/

    Thanks
     
  18. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    196
    Knock, knock... ( :) i've already posted earlier on this thread a script that (attached to cars) does exactly that, just download the script, and see inside how exactly the damage is done to NPC's & Player, Glass, and other objects...
    just hunt for those code lines i have entered there: easy - it's your best "tutorial" :)
     
    Defcon44 likes this.
  19. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    196
    You (probably) made a mistake assigning something the same way, in the InputManager entries. The axes on GamePads (as XBox controller and other
    game pads) are NOT treated the same as buttons, see: axes are - analog, not digital (as buttons are), so check what have you assigned exactly to what, in your Input Manager: (it should be under Edit--->Project Settings--->Input Manager) :)
    (the Xbox triggers are - axes - and are: analog) (also: seeing InputControl script will help you)
    :) kepp posted how it went further :)
     
    Defcon44 likes this.
  20. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Thank you, i go re check all today and make my feedback ^^
     
  21. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    Hi,
    I am noob in Unity, i bought this asset and help me a lot.I have a question with animations.I want to replace the npc with other.(an animal quadruped).I´ve tested with a free asset (spider) with no problems,(without mecanim ).In character Damage Script there is a Dead Replacement field where i have to use a ragdoll with the model, and here i have the problem.How to do this.A spider ragdoll,wolf,bear,an animal ......
    - It´s there a way not to use the ragdoll for Dead replacement?i have tried but the model is not removed after the "Body stay time".

    Thanks, hope you can understand what i mean

    Txarly
     
  22. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    374
    @Azuline Studios, Right now I'm implementing bolt action sniper rifle in my game, so I want to provide some feedback.

    Scopes is defiantly an area that could be improved. Current implementation in demo, with scoped AK, when you have scope as a part of the model is defiantly not ideal and has a number of downsides and almost no upsides. In my opinion drawing 2d gui of scope is the the way to go and this is an approach that is used in most shooters. Also currently it feels like system isn't super friendly to bold action rifles, I mean that it lacks features like allow bolt reload while scoped or not etc.

    It's not all doom and gloom and I'm able to implement scoped bolt action rifle in a game, but this does require extra work so this is an area that can defiantly be improved.
     
    OZAV and Dawar like this.
  23. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    196
    good point ...Scopes ... hmm...let me see what can i drop here, for users...
    say...why don't we suggest here to Azuline... and for users here: one nice
    glowing scope system, so - when you say, get in scope "Flesh" tagged obj,
    the scope will glow, in light green, so you know it's aimed ok ? Will post soon
    here, one my (earlier works) Glowing Scope scr, for RPFS...you guys drop
    me a line if anyone has problems setting it up (hope Azuline guys will read here,
    too, some time, this century...) :) ...sure i was working on one, with a friend of
    mine, before...i will check where it is, in the lumberyards of my laptops...:)
    ok, got it ...working on it ...now... ... ...let's get it ... ... ... to the top shape, first...
     
    Defcon44 likes this.
  24. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    196
    ...in CharacteDamage scr - you are currently confusing: Ragdoll mode, and
    Replacement mode, they are not the same, it's your problem i think, right now...
    Soooo...if you tick "RemoveBody" to ON, and assign the ragdoll you want,
    (under DeadReplacement),
    you should NOT tick to on "RagdollActive" bool. ok ?.
    First undertand, and try that little bit...
    So, if you don't use such ragdoll Replacement, (as described above), but only
    you want to use ragdoll MODE - it's the other way around, and you must have properly
    built ragdoll already, INTO your existing NPC first, to use the ragdoll MODE :).
     
    Defcon44 likes this.
  25. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    Hi

    Thanks A0101A for your help, but what i want it´s not to use any ragdoll.I want when the npc(spider) is dead by the player, plays the die animation and the npc(spider) is destroyed after x seconds.I have tried all the combinations and haven´t work.I attached a removebody script to the npc but if i enable it the npc disappear after 15 seconds.
    The NPC remains at the screen and the die animation doesn´t play either(spider dies but shoot animation loops), so what i want to know if with rfps i have to use ragdolls Yes or Yes always.


    I finally have understood it! i attached an object to dead replacement and attached the remove body script to that object and it works now


    Now another question, i have seen that any weapon the player has(for example a knife) the shadow it´s always a gun.Is it a bug ?
     
    Last edited: May 15, 2016
    llJIMBOBll likes this.
  26. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    The shadow you can disable, look on the wepon componment, near the end it says about raycast shadow, also on the camera main componement I think it says about raycast shadow, disable both... Also try using just 1 camera mode it will allow natural light for the weapon, but doesn't work for all scenes


    Im doing my own ai now, using both mecamin and legacy, both now uses a ragdoll for position damage, you can find the damage files on an old ai and copy paste to the new ai... I also found that after I set all ragdoll using unity, I can add other colliders for ragdoll like for the tail or I have a tripod with extra legs and bones, you can simply copy the colliders from other parts of legs and just re-asign the connected bone.
    I tryed once on a dog ai but didnt work too good was just a fur ball with a tail when I pressed play, but just need to set the bones right... I found a good way is to set the ai as humaniod first then do to edit it and check muscles, I printscreen which bones it auto sets and use them to set the ragdoll.

    :D
     
    Last edited: May 15, 2016
  27. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Hey the shadow you see on the ground is the third person players gun, you can simply change the model, or what I'm gonna do is have a model for each gun I have and make it auto switch depending on which weapon hes holding. Third person mode is still WIP.

    You can also just turn off the shadow
     
    OZAV and Defcon44 like this.
  28. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hi all !

    Little trick today for randomly level user, if you want to use the Unity NavMesh in a random level you can watch this

    VIDEO

    That works perfectly for me but do not forget to check the "carve" case because the navmesh don't take the obstacle if this case is not checked.

    Hope this help somebody :)
     
    OZAV and llJIMBOBll like this.
  29. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    489
    Hello guys,
    Can any1 tell me how to use weapons with projectlies like rocket launcher.
    I checked bow and arrow wepaon but there doesnt seem to be any option to change the projectlie.
    So does any1 knows how to do it. I am tyring to create a rocket launcher.
     
  30. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Hi, the projectile the weapon fires is under projectile pool, it should give a number on the weapon, you can find the object pool under fps component.

    It will need a new script tho as the grenades are timed, I'll post mine once I get round to doing my rpg. It needs a on collision script that deals damage when it hits a collider.
     
  31. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    489
    Hi thx
    But how do i set pool number on my rocketlauncher projectile??
     
  32. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Got a few Ai's hooked up to RFPS Ai, Just using RFPS Ai in this, plus I've added new Player and Weapons... This is just some Testing... I added extra Muzzle Flashes for the tripods plus changed to use particle systems instead, gives much nicer effect
     
  33. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    On the Weapon Behaviour Script near the top look for Projectile Pool Index, for Grenade and Arrows I think its, 16 and 17. Then on the Player Open once so you see FPS Camera, FPS Effects etc.. near bottom look for Object Pooling Manager, in there your object to the corresponding number, so for grenade 17 look under the 17 tab :D
     
  34. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    489
    Are those weapon animations mecanim??
     
  35. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    all the ai use mecanim apart from 3 of them... Even the slime ai only has 4 bones but I added a ragdoll, I found you can just copy and paste from another and just re-target the bones on the physics script bit

    Im new to animations and just wondering is it possible for the attack animation can we use a blend tree and have 2 or 3 different animations it can use randomly?

    Thanx
     
  36. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Great jobs Jimbo !!!

    I love your UI and the red dot of the scar *-* Do you make it ?

    I go follow your game now :)
     
  37. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Hey Thanx :D, the red dot came with the Scar weapon from asset store :D Yeah I made the Ui just temp colours for now :D I used a UI kit from asset store by Levoto Studios I think :/ :D
     
    Defcon44 likes this.
  38. gunsroses

    gunsroses

    Joined:
    Jan 7, 2014
    Posts:
    6
    Hello My English is bad soory :/
    Realistic fps car controller Is it possible ? Vehicle stroke and riding?
    I'm trying for days.
     
  39. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hi,
    Please, before post a question can you read the last 2 / 3 page ?

    Thank you
     
  40. gunsroses

    gunsroses

    Joined:
    Jan 7, 2014
    Posts:
    6
    Thank you for your interest.

    I do not understand what is the writer.
    Do you have a video tutorial?I apologize again
    I'm having problems because english :(

    Door object script
    http://pastebin.com/EnzWGZY8
     
    Last edited: May 16, 2016
  41. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    196
    GLOWING SCOPE SCR - for RFPS USERS - DOWNLOAD HERE
    -OK, as i promised, it's ready. The rules (and best practices):
    -attach script to your "scope" child object of your Sniper weapon,
    -target tag - put "Flesh" for initial tests, until you understand all better,
    -Sniper Range - the range of your sniper (as is, by your weapon setting),
    -Layer Mask - by which layers should search for aimed target be done,
    -RayOrigin - it's best to pull your Main Camera here...
    -Scope - your mesh renderer, of your "scope" child object of your Sniper,
    so - if it sais "scope (Mesh Renderer)" - than you have selected right).
    -For scope material - choose your normal (or RFPS default) scope material,
    called "scope"
    -glow material - here, assign any glowing material you want for glow effect
    (the best is to make, and to assign that material with some glowing shader
    here, eg. Objectify shaders are pretty good, making it pulsate+glowing,
    as well, etc, or similar glowing shaders pack, form the store).
    -i've set default detection tag to "Flesh" i think, but you can change it :)
    ( ! Attention Azuline Studios, as well !)
    Michael.
     

    Attached Files:

  42. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    489
    Hi
    How do you apply damage to NPCs.
    I tried using sendmessage function but it gives me error
    Code (CSharp):
    1. col.GetComponent<Collider>().SendMessageUpwards("ApplyDamage",damageAmount, SendMessageOptions.DontRequireReceiver);
    Failed to call function ApplyDamage of class CharacterDamage
    Calling function ApplyDamage with 1 parameter but the function requires 8.
     
  43. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    196

    First, we need to make clear:
    1 From which script you are calling the damage to NPC (script name) ?
    2 Are you calling that damage to CharacterDamage scr, on your NPC ?
    (i don't see much error there, but: you only need to satisfy damage parameter
    properties, i think, and for many weapons, or explosions, or say arrow, they are
    different in RFPS)... this is (still) one of RFPS disadvantages, at the moment,
    untill they fix it under only one method (some day), but till than - you must be
    carefull what you write after "ApplyDamage" ... (which are damage parameters,
    and conditions)... maybe: col.GetComponent<Collider>().SendMessageUpwards("ApplyDamage",damageAmount); (as the example)...
     
    Last edited: May 17, 2016
  44. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    489
    Hi
    I am calling damage to NPC from my explosion script in my rocketlauncher. Bassically when rocket explodes it calls applydamage no enemy in explosion radius. I have no idea why error occurs
     
  45. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    On Weapon Behaviour around line 2145 - 2188 it refers to the Arrow Object and Grenade Object scripts, I tried a few days ago to add explosion damage from my rocket script but had problems.
    I just found it referring to them two scripts, so I'm guessing you may need to add your script to Weapon Behaviour? I'm not sure.
     
  46. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    196

    ...you will need to post "your explosion script" here, so we can have a look inside,
    and pleasse - confirm for us (with yes or no), that you are calling that
    damage to CharacterDamage scr, which is on your NPC you are trying to kill.
    (as, most of us here are still not getting what's (exactly)
    going on over there in your project...) please, make this clear for us, first...
    also:
    ***if you use original RFPS script as "your explosion script" you may have just
    forgot to assign blast mask layer, (or tag) on which your targeted NPC is...
    ,,,in RFPS< keep all your NPC's (always) on layer 13, which, in RFPS scripts
    is always referred to as "case 13" [which means hitting Layer 13 with NPC's]
    when the hit occurs...
     
    Last edited: May 18, 2016
  47. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    489
    Yes i am calling on characterdamage of enemy
    I got it working i had to change code a bit
    Code (CSharp):
    1.     Collider[] cols = Physics.OverlapSphere(transform.position, explosionRadius);
    2. foreach (Collider col in cols)
    3.             {
    4. //col.GetComponent<Collider>().SendMessageUpwards("ApplyDamage",damageAmount, SendMessageOptions.DontRequireReceiver);
    5.                 if (col.GetComponent<CharacterDamage>())
    6.                 col.gameObject.GetComponent<CharacterDamage>().ApplyDamage(damage +damageAmount, transform.forward, Camera.main.transform.position, transform, true, false);
    7. }
    I just copypasted this from arrowscript and it worked. It still doesnt work with orginall sendmessage though.
    Thx for help
     
  48. egem2015

    egem2015

    Joined:
    Oct 27, 2015
    Posts:
    54
    Hi everybody.

    This asset looks like awesome. I will buy it on May 29.Please dont increase the price.

    and i want to ask a question.


    does this asset have mobile controls such as joystick ?

    if not i will buy Control's Freak asset also.

    thanks in advance
     
  49. thegamerguynz

    thegamerguynz

    Joined:
    Apr 1, 2016
    Posts:
    20
    Hi guys, just a query, I've got my new npc meshes and animations all working fine, damage both ways id fine, but when the npc dies the ragdoll wont disappear, nor will the ammo object appear. i have the body stay set to 15 and gun stay to 30,
    and the ammo object and gun objects set correctly. what gives?


    *EDIT:
    ok i fixed it myself lol hadn't put removebody.cs onto my ragdolls.

    added an instantiate call to the removebody script to create the weapon pickup item.
     
    Last edited: May 20, 2016
  50. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    hi,thanks to all for your help,

    I am thinking to add behaviours like flee,wander... to npcs.I have seen "Behavior Designer Movement Pack" that has scripts at a good price and i wonder if should be very difficult to implement with rfps, anybody has tried this ? if not,others like ice creature control or emerald ai?
     
unityunity