Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Realistic FPS Prefab [RELEASED]

Discussion in 'Assets and Asset Store' started by Azuline-Studios, Apr 5, 2013.

  1. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    I'm just publishing them, taking care of all the administrative Asset Store work and any support questions folks might have. The artist is Steve Finney at Arteria3D. He's doing some amazing work, like this Samurai, these Vikings, and these knights for UMA. We'll also be publishing non-UMA versions, too.
     
  2. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    475
    hello! i am trying to make the player to activate a trigger, but i cant seem to do it.
    i already put the trigger script either on the player camera, or the player model, but neither work.
    any ideias please? i am using the genesis script from the unity store.
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    Hi @paulojsam - Sorry, I don't think people are ignoring you. I just don't know anyone who uses Genesis Code. Maybe the script needs to be on the target object and not the player? Make sure the objects are set up to register trigger collisions: they have rigidbodies and colliders, and the collider with the Genesis script has its Is Trigger checkbox ticked. If that doesn't help, try contacting the Genesis developer.
     
  4. Hammre

    Hammre

    Joined:
    May 23, 2016
    Posts:
    8
    Tony, finally got around to implementing the save system and it worked like a charm. Would have been even easier if I had started with it :) Really like the flexibility of using it as an out of the box solution with prefabs, or calling things directly from your own scripts.
     
    jons190 likes this.
  5. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    256
    Hi again,

    is there a way to use the RFPS - "Faction war" and "Wave survival" with Emerald AI Agents ? :confused:

    As of now the wave spawners will only spawn the first NPC load of Emerald Agents, but killing does not seem to unregister them from the wave manager and the wave spawners will not continue to spawn. Also the number of "remaining NPCs" does not decrease...

    As always - thanx in advance. Any help is much appreciated! :cool:
     
  6. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    Hello to all. I am trying to create a trigger so when the player enters, change its faction (let's say from 1 to 2). Also change his texture (wearing faction's 2 clothes for instance). Thank you in advance.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    Thanks! :)

    Mixing the AI systems is dicey. You might be better off asking Will at BHS to consider adding a wave system to Emerald.

    If you want to forge ahead with the mix, you'll need to add a script that unregisters the AI from RFPS. For example, CharacterDamage.cs does it like this:

    Code (csharp):
    1. AIComponent.NPCRegistryComponent.UnregisterNPC(AIComponent);//unregister NPC from main NPC registry
    You can hook this script up to the Emerald_AI's OnDeath() UnityEvent. I haven't tested this, so I don't know what other repercussions it might have.


    Somewhere way back in this thread I posted a general-purpose trigger event script. It looks something like this:

    TriggerEvent.cs
    Code (csharp):
    1. using UnityEngine;
    2. using UnityEngine.Events;
    3.  
    4. public class TriggerEvent : MonoBehaviour
    5. {
    6.     public string requiredTag = "Player";
    7.     public UnityEvent onTriggerEnter = new UnityEvent();
    8.  
    9.     private void OnTriggerEnter(Collider other)
    10.     {
    11.         if (other.CompareTag(requiredTag)) onTriggerEnter.Invoke();
    12.     }
    13. }

    Add a trigger collider to your NPC (or an child GameObject). Configure the OnTriggerEnter() event to set its AI component's factionNum and change its material.
     
    C_Occlusion, Weblox and Mark_01 like this.
  8. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    Thanks a lot!
     
  9. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    256
    @TonyLi

    Thanks a lot for all your time and effort. Great to see you are still keeping this thread alive. :D

    Hooking into the death event with an external script to unregister the NPC was exactly what I had in mind. It's a shame I still dont have coding skill to turn your hint into a valid script. :confused:

    Going through my Assets I found the CoreGameKit in my toolbox. It might have a slight learning curve and may be overkill for this current Project, but this seems a good alternative also...
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    Is CoreGameKit integrated with Emerald? It might not matter, since I think you can do everything in the inspector with both of them, but integration would certainly make it easier.
     
  11. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    256
    Wow @TonyLi - that was an instant reply ! :p

    Now that you mentioned I do not see Emerald AI on the CoreGameKit Integration list.
    I have not been active on their Forum yet, but I think that's a good place for requesting Emerald Integration, if needed. I suppose the RFPS Wave UI will not work with CoreGameKit, so this might be an issue. I still have alot of work to do in my RFPS Project so I am not in a great rush, but having the wave survival with Emerald Agents would be a great benefit for me.

    Thanks for all your help and keep up the good work ... ;)
     
    Last edited: Aug 31, 2018
  12. jijones

    jijones

    Joined:
    May 16, 2018
    Posts:
    4
    hey guys its me again i was looking at doing ammo penetration for different materials and bullet drop I found an asset but from what i can see in the tutorials I'm unsure how i would implement it to RFPS, I was wondering if anyone has tried it with the RFPS before i buy the asset here is the link https://www.assetstore.unity3d.com/#!/content/72755

    Also does anyone know how to make a health meter like Doomguys face something i miss and wanna try out thanks.
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    Both of those would require you to make changes to RFPS's scripts. I'd recommend doing them only if you're comfortable with scripting or can find someone to do the scripting for you (e.g., hire someone on Unity Connect).

    For the health meter, you could modify HealthText.cs.

    For the ammo penetration, you'd have to dig into the FPSPlayer.cs and CharacterDamage.cs scripts.
     
  14. GameMunchers

    GameMunchers

    Joined:
    Jul 3, 2017
    Posts:
    37
    Two things one, how can i add stamina bar to v 1.23?
    and second how do i remove the sneaking feature when you go behind an enemy and one shot it.
     
  15. GameMunchers

    GameMunchers

    Joined:
    Jul 3, 2017
    Posts:
    37
    i get an error timetemp does not exist in the current context
     
  16. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    @TonyLi I managed to create a trigger to change NPCs faction and FPS Player mesh material. But, when I restart the game FPS Player still wearing the changed clothes. The albedo of the FPS Player material has permanent changed.

    On TriggerEvent component I used Material.CopyPropertiesFromMaterial. Is this wrong?

    Thank you in advance.
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    Can you set the renderer's material instead?
     
  18. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    Sorry, what does that mean?
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    Set the SkinnedMeshRenderer's material property. For example, the event below applies the 'apple' material to Robot2's SkinnedMeshRenderer:

    material.png
     
    Weblox likes this.
  20. Mucossa

    Mucossa

    Joined:
    Feb 25, 2018
    Posts:
    34
    why is not there a multiplayer plugin? can anyone do not it? photon or unet ... nobody can do it? paid or free of charge.
     
  21. GameMunchers

    GameMunchers

    Joined:
    Jul 3, 2017
    Posts:
    37
  22. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    131
    Stamina
     
  23. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    Hello, is there a way for the Thirst number to count from 100 to 0 and not from 0 to 100? I use it as an antidote.
    Sorry, I have so many questions :) Thank you.
     
  24. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
     
  25. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    131
    100 - thirst value
     
  26. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    Can you be more specific please?Thank you.
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    If your model uses multiple materials, you may need to do a little scripting. For example, the built-in soldier's SkinnedMeshRenderer uses two materials. The first material, which is what you can assign in the Trigger Event, is for the helmet. If you also need to change other materials, you'll need to assign to SkinnedMeshRenderer.materials[] in a script. Or switch to a model that uses only one material.
     
  28. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    I don't know how to do scripting, but thank you very much for your time to answer! I appreciate that.
     
  29. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    223
    This comes up every few weeks and I think It would be an awsome update to the overall kit. I thought someone at least attempted it in this thread a few months back in Photon???? and actually thought they had it working, but I may be remembering it wrong..... Maybe Tony Li or someone else with a tad more skillz could chime in as to why this seems to be a hard problem to solve.... Seems like it should at least be doable....but what do I know....
     
  30. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    223
    I have been interested in doing this exact thing with thirst. Using it as a antidote to poison. Did you figure this one out? Might be as easy as just swapping the values in the prefab from 0-100 to 100-0.... maybe.....
     
  31. jijones

    jijones

    Joined:
    May 16, 2018
    Posts:
    4
    Hey guys i recently got a bug I created my player's character on Adobe Fuse and I followed the instructions so when i go to play it and jump to the third person camera it shows both the third person model and the visible model is visible no matter which camera it jumped to both are seen.

    Wish there was a system like Invector that you drag and drop the model on it and rigs everything for you maybe something to add on the next update a rigging system for both weapons and humanoid characters.
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    Multiplayer is just significantly more complicated than single player. And it's even more complicated if you're trying to retrofit a kit that wasn't designed from the beginning for multiplayer. I can list specifics if you want (physics synchronization, server authority, client-side prediction, lobby & matchmaking, etc.), but the gist is that the work to write a multiplayer shooter is 50% shooter and 50% multiplayer. And if you start with a single player shooter kit, you're actually less than 50% of the way there because you need to undo and rewrite some of the design decisions in the shooter part to support multiplayer.
     
    jons190 and Mucossa like this.
  33. GameMunchers

    GameMunchers

    Joined:
    Jul 3, 2017
    Posts:
    37
    Really?! can you please explain or share the stamina system with me??
     
  34. GameMunchers

    GameMunchers

    Joined:
    Jul 3, 2017
    Posts:
    37
    Does the RPFS Save System Work With RFPS V. 1.23 ???
     
  35. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    131
    This is the code if you use a slider for stamina:
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using System.Collections;
    4. public class StaminaBar : MonoBehaviour
    5. {
    6.     private Slider staminaBar;
    7.     private FPSRigidBodyWalker walker;
    8.     private float oldStaminaAmt = -1;
    9.     void Start()
    10.     {
    11.         walker = FindObjectOfType<FPSRigidBodyWalker>();
    12.         staminaBar = GetComponent<Slider>();
    13.         staminaBar.maxValue = walker.staminaForSprint;
    14.     }
    15.     void Update()
    16.     {
    17.         //only update if value to be displayed has changed
    18.         if (oldStaminaAmt != walker.staminaForSprintAmt)
    19.         {
    20.             staminaBar.value = walker.staminaForSprintAmt;
    21.             oldStaminaAmt = walker.staminaForSprintAmt;
    22.         }
    23.     }
    24. }
     
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    Yes.
     
  37. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    475
    is there any tutorials to replace player and ai models? i want to create archers
     
  38. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    475
    how can i make the ai arrows stick like the player arrows?
     
  39. Hammre

    Hammre

    Joined:
    May 23, 2016
    Posts:
    8
    Has anyone used RFPS with Cinemachine virtual cameras? I'm trying to set up an intro level with a cutscene that ends with returning control to the RFPS main camera. Most cinemachine tutorials assume you are just using their virtual cameras for your game camera as well.
     
  40. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    223
    There are a bunch. I made some archers and majic bolt throwing wizards. It was fairly easy to convert the existing stuff over.
     
  41. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    475
    can you please post link regarding them, i also wonder if its possible to have the ai shoot arrows that stick to the surfaces just like the player
     
    ThePotatoBoss likes this.
  42. hoschi3d

    hoschi3d

    Joined:
    Oct 4, 2014
    Posts:
    6
    Hello, Is it possible to release the camera from the player in the third person mode? I would like to have static cameras for my project, but unfortunately I can not solve the standard camera without the character being unable to control
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,695
    The MovePlayerAndCamera script (on FPS Camera) has a method ReleaseMainCamera(). Call it once to release the camera from RFPS's control. Call it again to give control back to RFPS.
     
  44. jandd661

    jandd661

    Joined:
    Jun 25, 2017
    Posts:
    17
    Sorry, should be
    Code (csharp):
    1. timeTemp = 0f;"
    Better late than never I guess. Sorry for the delay.
     
  45. jandd661

    jandd661

    Joined:
    Jun 25, 2017
    Posts:
    17
    I would like to urge the dev(s) to get a proper forum. This thread has become to large and is not useful when trying to see if the question has already been asked. Also questions get buried quickly. I'm sure @TonyLi must get frustrated answering repetitive questions. A quick search found some free ones:

    https://www.proboards.com/
    https://www.createaforum.com/

    please, please, please =)
     
  46. NickNovell

    NickNovell

    Joined:
    Apr 27, 2017
    Posts:
    51
    Hello to all again. In Third person view when the camera collides on an object (clip mask=default in CameraControl.cs) it zooms to the player when rotating the camera. The result is the camera to get through the player model. How we can do so when the camera collides to an object, not to zoom to the player?

    Thank you.
    Untitled-1.jpg
     
    Weblox likes this.
  47. mshakeri226

    mshakeri226

    Joined:
    Sep 10, 2018
    Posts:
    1
    I've created a player using rfpsp and uma and now i got an issue on adding NPCs. Im trying to add a soldier but the soldier doesn't do anything and just stands there and just stares at me. I have no idea what to do.
     
  48. C_Occlusion

    C_Occlusion

    Joined:
    Jun 4, 2012
    Posts:
    42
    I have never used the UMA characters but maybe you can find something in this video...hope it helps you out...

     
  49. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,557
    Core GameKit works with EmeraldAI as long as you make sure you call the EmeraldAI ResetAI function if you are re-using prefabs for spawns. Otherwise a spawn will be in the wrong state such as already dead from previous use.
     
    Weblox likes this.
  50. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    256
    Can you explain how to do this plz? Also, thnx in advance! o_O