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
    Hi - @JACKO4590 answered it here. In brief, on those error lines change "return" to "yield return null". RFPS still needs to be updated to officially support 5.5, so those changes aren't in there yet.
     
  2. al3d

    al3d

    Joined:
    Feb 7, 2013
    Posts:
    51
    Ok thanks it works now !
     
  3. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    Ugh, these errors are getting so annoying haha. I don't know what I did but now I have these errors . .
     

    Attached Files:

  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Did you create the Player object in the Bolt Assets section of the original post?
     
  5. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    Yeah see
     

    Attached Files:

  6. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    The error is referring to not having a reference to any prefab called "Player", make sure one exists with the Bolt Entity component on it then compile assembly
     
  7. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    It worked but the only thing I am confused about is when I play the scene that part of the fps player gets destroyed and the child's inside of it aren't
     
  8. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    How would I spawn the characters now and setup spawn points?
     
  9. Locky

    Locky

    Joined:
    May 14, 2015
    Posts:
    86
    Okay, I've got a gripe and a request.

    I have posted the same question three times; Oct 23rd, then again Oct 27, and then again Nov 8. It has now been 6 weeks since my initial post.
    My gripe is; what does it take to get a response? Am I not part of some special club that I am aware of? (Sarcasm). I see responses to virtually every other post. I was patient and waited. I re-posted, but still nothing. And I posted again. Seriously you are giving me a complex! If I am not providing enough information to answer the question, then please let me know. But could I get a reply? Or is there some other method of communication that I am not aware of? Because so far, I am not impressed!
     
  10. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    ?
     
  11. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    I don't have this asset store package so I don't know for sure. You can instantiate Bolt entities by using BoltNetwork.Instantiate
     
  12. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    Oh ok, well tony do you know how to do it?
     
  13. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    @Locky Ok,to release the gripe I will try my best to answer. If you open the Bow model and have a look at its animations you can see this model does not have the animation you are looking for. I suppose if you have another model for bow (with arms) that has one animation like the one you want included you can quite easily replace the default bow weapon with the new one and set up the animations accordingly. So to be clear : If you want to run around with your bow that has the arrow in place already you need to integrate your own model that must have the proper animation included :)
     
    Locky likes this.
  14. Locky

    Locky

    Joined:
    May 14, 2015
    Posts:
    86
    Weblox,

    Thank you for your reply! I was hoping it was just a setting or a code change somewhere that I missed. But that gives me a place to start!
     
  15. Dionysos1111

    Dionysos1111

    Joined:
    Feb 14, 2016
    Posts:
    39
    Hi,

    I'm trying to create a Aim Assist in RFPS.

    Untill now i have this:

    using UnityEngine;
    using System.Collections;

    public class AimAssist : MonoBehaviour
    {

    public GUITexture guiTex;
    public Ray Ray;
    public LayerMask rayMask;

    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {


    Ray = (Camera.main.ViewportPointToRay(guiTex.transform.position));

    RaycastHit hit;

    if (Physics.Raycast(Ray, out hit, 1000, rayMask) && hit.collider.tag != "Wood")
    {
    Camera.main.transform.LookAt(hit.collider.transform);
    }
    }
    }


    This makes the camera and crosshair follow the enemy colliders but the weapon itself doesn't follow the crosshair.

    Does anyone knows how i can let the weapon follow the crosshair for a auto aim? or maybe someone has already implemented a auto aiming system and can share it with me.

    I already tried some things with the deadzone aiming but it's just to complicated for me, i can't figure out how that works.

    Any help would be greatly appreciated.
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @DecayGame - I'll try to make some time this week to take a quick look at Bolt + RFPS again. If I have any success, I'll post here.

    @Locky - Sorry you were starting to get a complex. I for one hadn't tackled that topic yet, so I didn't reply. I'm glad @Weblox was able to help out.
     
    Locky likes this.
  17. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    RFPS isnt compatible with multiplayer i think.
    I tried RFPS with photon and it was way too hard to implement bec of way rfps player prefab splits.
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    The trick is to put the multiplayer components on the FPSPlayer child GameObject, unless you've set up a script to handle the splitout.
     
    Last edited: Dec 14, 2016
  19. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    477
    Hi Everyone,

    I have an NPC enemy using an NPC Trigger Spawner Script that is deactivated at game start and I activate it using another object (collider) with Activate Trigger script on it that activates these things when a non AI game object collides with it. I want to spawn 3 enemies at a time and have a max of 5 alive at one time. This all works fine as it should just as if it was a simple object with NPC Trigger spawner the player would collide with as the activator.

    I have a problem in that I want the Spawner to reset itself after it has spawned its allocation of 3 enemies so that the collider object that activates it can collide with it again later and spawn another 3 enemies but I cant get the NPC Trigger Spawner to reset itself and activate more than one spawning. I know I can have unlimited enemy spawning but that's not what I need but as described.

    I have tried numerous things and looked around Unity and the web for an alternative but not found anything yet to effectively reset The NPC Spawn trigger?

    Thank you for any help or advice

    Thanks

    Peter
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    It's still a bit rough, but I updated the instructions for RFPS 1.23 in the original post. If you come across anything I forgot to include, please let me know and I'll update the original post.
     
    emperor12321 likes this.
  21. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    hi
    when i play the scene rfps is disabling the sunshafts component in the main camera.Is there an option no to do this or which is the script that controls this?

    thanks
     
  22. Dionysos1111

    Dionysos1111

    Joined:
    Feb 14, 2016
    Posts:
    39
    I think you mean the "Reconfigure Prefab" on the FPS Camera.

    When you remove the Reconfigure Prefab component the error will be gone.
     
  23. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    thanks it works
     
  24. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    oh okay thank you =-)
     
  25. Dionysos1111

    Dionysos1111

    Joined:
    Feb 14, 2016
    Posts:
    39
    Anyone an idea of my previous question on how to make an AimAssist??
     
  26. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    For bolt how to edit the character spawn location?
     
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    In BoltPlayerCallbacks.cs, modify the SpawnPlayer() method. Currently it's hard-coded to spawn the player in a random location:

    Code (csharp):
    1. public BoltEntity SpawnPlayer()
    2. {
    3.     BoltEntity player = BoltNetwork.Instantiate(BoltPrefabs.Player);
    4.  
    5.     // set position for entity
    6.     player.transform.localPosition = new Vector3(UnityEngine.Random.Range(-8f, 8f), 4f, UnityEngine.Random.Range(-8f, 8f));
    7.     player.transform.localEulerAngles = new Vector3(0f, UnityEngine.Random.Range(0f, 360f), 0f);
    8.  
    9.     return player;
    10. }

    CremaGames wrote a good blog post on how they implemented aim assist in UFPS: The auto-aim for the gamepad

    If you're comfortable with code, you could implement something similar for RFPS.
     
  28. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    So on the Glock_Anim I checked all the animations there fine but Idk what is going on here if someone else does please let me know thanks.
     
  29. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    You can try to check / uncheck the "Do Weapon roll" - Property in the "Bobbing and Sway Amounts" - Section of your weapon. I am not sure if thats whats happening here, but I remember that I had to check there when upgrading from the previous version.
     
  30. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    Thank you that worked but do you know why the bullet is so big lmao XD
     
  31. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Lol, you can check for the Spawn Shells Size and make it lower should work
     
  32. Weblox

    Weblox

    Joined:
    Apr 11, 2016
    Posts:
    277
    Also as far that I can tell, in the video it seems there are bullets included with your models animation, that appear in the right size. If thats the case then you might get away with disabling the (additional) Rfpsp - bullet spawning. xD
     
  33. DecayGame

    DecayGame

    Joined:
    May 15, 2016
    Posts:
    86
    Il give it a go brother. Thanks
     
  34. YellowBean929

    YellowBean929

    Joined:
    Dec 6, 2015
    Posts:
    2
    Has anyone tried RFPS for a VR game? I bought it thinking that the AI scripts could be easily implemented into the Zombies in my game, but it seems to be much more complicated than I thought as how the way NPCs detecting the player. Has anyone tried it and share some of your experience?
     
  35. gunsroses

    gunsroses

    Joined:
    Jan 7, 2014
    Posts:
    6
    Hello,

    My English is bad sorry


    I want to remove the weapon system

    how can I do it?


    I just want to use the camera and motion system, but I face constant mistakes
     
  36. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hi just remove all the weapons but keep the top null weapon, then you dont need to remove the weapons system scripts
     
  37. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    Anyone wonna give me a hand and tell me why this is popping up? NPC also wont attack but if i shoot a weapon they will run towards me got about 5 seconds then give up like they cant see me. Any help will be appreciated.

    NullReferenceException: Object reference not set to an instance of an object
    AI+<AttackTarget>c__Iterator3.MoveNext () (at Assets/RFPSP/Scripts/AI/AI.cs:878)
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

    Code (CSharp):
    1.             float distance = Vector3.Distance(myTransform.position, target.position);
     
  38. gunsroses

    gunsroses

    Joined:
    Jan 7, 2014
    Posts:
    6
  39. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    ok edit: That error comes up on a new project and the sandbox NPC's on both my project and the new project work. So they shoot and run over to the player.

    Currently on my custom map they wont shoot at all and when i fire a weapon then run into me for about 5-10 seconds.

    Any ideas would be great thanks

    EDIT: Got it to work, i feel so stupid. I have a big box collider that once a player leaves it comes up with a text saying end of demo. Its on trigger but im guessing that is interfering with the NPC's.

    Man this has set me back 2 days hahaha
     
    Last edited: Dec 26, 2016
  40. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    I'm using RFPS 1.21. I've looked into scripts, but I can't figure out how to achieve effect camera movement when I'm zoomed in with my sniper rifle. You can see this effect in a lot of games, when you don't hold your breath using sniper rifle.

     
  41. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I started using this in my own scene and I put the FPS Main prefab in the scene. That works great except I noticed that my indoor scene had light shafts coming from all over. So I looked into the prefab camera components and the weapon camera has a bunch of camera effects on it, including sun shafts. I thought "No big deal because I can just remove them. " However, that's not exactly true. The ReconfigurePrefab.cs script requires 3 of them. The following 3 components are referenced in code:

    Code (CSharp):
    1.     private UnityStandardAssets.ImageEffects.SunShafts SunShaftsComponent;
    2.     private UnityStandardAssets.ImageEffects.ColorCorrectionCurves ColorCorrectionCurvesComponent;
    3.     private UnityStandardAssets.ImageEffects.BloomOptimized BloomOptimizedComponent;
    I ended up just removing the code that references them, but these really shouldn't be in there.
     
    OZAV likes this.
  42. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    You can safely remove from re configure script, this is just for having either 1 camera setup or 2 cameras, and it will auto turn off the image effects for the camera you dont use. RFPS you dont need to use a separate camera for the weapon :D
     
  43. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    Sorry, guys, has anyone asked / answered here yet:
    -How do we (quickest) get RFPS stock characters to point the guns up properly,
    if the target is higher than even level ? (so far - they can't aim rifle UP/DOWN, at all).
    RFPS - AIM IK.PNG
     
    Last edited: Jan 4, 2017
    llJIMBOBll likes this.
  44. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    477
    Hi all,

    Whats the secret to getting ladders to work?

    I am sure this has probably been asked and answered somewhere?

    I have never been able to get them to work using my own ladders but the default demo one does. As far as I can see my ladders are set up exactly the same in structure though using bespoke ladder models. Do they work in V1.23 which I am using?

    Thanks for any help.

    UPDATE : OK Fixed it so no worries. Thanks :)

    Peter
     
    Last edited: Dec 31, 2016
  45. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Hi All,

    Has anyone done a Rewired integration with this asset yet? Just wondering if there is something already available before I start working on making changes in InputControl.cs.
     
  46. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    Okaaaay, my RFPS co-sufferers, it behaves ok so far... so - here for release is, my...
    BETTER RFPS LADDER (V1.0) :) community version, goes without the saying :).
    Color, model,and material it - to whatever you want to make for your ladders,
    projects-wide. ***Please, consider a donation - see ReadMe file, (in the asset, included),
    if this asset helps you, in any way.
    Your thoughts, comments, donations, etc, much appreciated, i hope it helps :)
    ***Attention, Peter, i think you asked about this earlier, cheers------------------Michael.
     

    Attached Files:

    Last edited: Jan 5, 2017
  47. VoltzStudios

    VoltzStudios

    Joined:
    May 29, 2015
    Posts:
    17
    I just bought the asset and I got this error when I tried to run the sandbox scene "Occlusion culling data is out of date. Please rebake"
     
  48. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    That's good you are helping others with a more efficient system. Just a question do you have a video that demos how differently it works to the original. I'm not home atm and before I download something I may not need its always good to see what it does first.
     
  49. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    It's simple as putting prefab into a RFPS scene, and play with it, and look into the script if interested in more details - you can always do that later... :)
    The Ladder will activate/deactivate each time you press your (Input Manager- assigned) "Use" button.
    So, very simple, no need for videos / manuals, really, the script is well commented, as well.
    I'm very happy that we achieved that HL2 ladder style, for RFPS users :) Currently i'm doing one version of ladder with just capsule collider, as well, to add for variety, and will be also included in later versions of package, also listed here, so with that extra one - will be possible to do more free shooting around the ladders without hitting ladders too much, by raycast and projectile bullets (fire)...
    ***
    What i would like to know is - how do we get the RFPS stock characters to aim up and down,
    it will be also good to have that in the next RFPS version update, or - someone can make it for us, here ? (something easy, like a patch for that, or a quick fix - the simpler, the better ...)
     
    Last edited: Jan 6, 2017
    JACKO4590 likes this.
  50. VoltzStudios

    VoltzStudios

    Joined:
    May 29, 2015
    Posts:
    17