Search Unity

Realistic FPS Prefab [RELEASED]

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

  1. petercoleman

    petercoleman

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

    I have an issue with terrain texture map and am receiving a non critical console error message and have a read about the error in general but don't know how to correct it in the Footsteps.cs script.

    Texture rectangle is out of bounds (1675 + 1 > 1024)
    UnityEngine.TerrainData:GetAlphamaps(Int32, Int32, Int32, Int32)
    Footsteps:GetTexturesAtPoint(Vector3) (at Assets/RFPSP/Scripts/Player/Footsteps.cs:296)
    Footsteps:GetTerrainTextureIndex(Vector3) (at Assets/RFPSP/Scripts/Player/Footsteps.cs:307)
    Footsteps:FootstepSfx() (at Assets/RFPSP/Scripts/Player/Footsteps.cs:212)

    Not had this appear until recently and have not done anything different as far as I am aware.

    Any help would be appreciated so I can just remove the annoying console error message and don't like them hanging about and compounding or one ends up with endless numbers.

    Thank you kindly.

    I hope you are all well and still developing :)

    Peter
     
    jons190 likes this.
  2. Oderus_Urungus

    Oderus_Urungus

    Joined:
    Jun 8, 2017
    Posts:
    96
    Has anyone found an actual fix for the camera in third person clipping though the environment and player mesh? I'm on 2019.1 and the last update for RFPS and the issue seems to persist.
     
  3. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Ahhh taht actuall clears a few things up for me.
    Ahhh that actually clears a few things up for me....

    Anyway. Got it working.
    Built out a new project with all the latest greatest stuff. unity 2018lts, ovr 1.39, rfps 1.4 and the latest save system. Everything seemed to work right out of the box.


    then went back to my project, deleted whatever version I had of the save system, re-imported the newest and then cleaned up all my player settings in each level and got it all to work. There seems to be issues around the saver key. but I haven't put my finger on it exactly yet. I suspect I am doing some funky user scenarios with scean transitions that you might not have thunk of. Tonight I am going to try the "add a few seconds before loading" setting. I think I had issues with that as well before... but as it stands , everything seems to be working like it should.... cheers mate!
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @jons190 - Great! Sounds like you're making good progress. Every saver should have a unique key. An easy way to assign unique keys in a scene is to select menu item Tools > Pixel Crushers > Common > Save System > Assign Unique Keys.... If you don't like the random numbers assigned to each saver, you can always change individual keys manually.
     
    jons190 likes this.
  5. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    Sorry my inglish.

    Can someone help me, I don't know if it has been commented before in the forum.

    I am working in the third person, there is some way that when the character is stopped turn when the camera turns, if I start to walk the character is oriented with the camera, but when I stop, I turn the camera and the character keeps looking and does not follow the camera.

    can you help me? I don't know if it brings the option, or you have to touch some code,

    thx!
     
  6. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    I found it! ;)

    thx!
     
  7. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    Hi!

    I am trying to do the following without success.

    when I select a weapon from my inventory
    this weapon is activated and the model is visible
    when it is active, I want to select a specific RFPSP weapon, for example the knife, which is the (1) of the "Weapon Order"

    if it is hidden, select the weapon (0) that is the! Unarmed

    I have another script that I load all the weapons as soon as I start

    void Start ()
    {
    FPSPlayerComponent.PlayerWeaponsComponent.GiveAllWeaponsAndAmmo ();
    }

    can you please help me!

    thx!
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @sebasfreelance - To activate a weapon, run the PlayerWeapons component's SelectWeapon(#) coroutine.

    For example:
    Code (csharp):
    1. var playerWeapons = FindObjectOfType<FPSPlayer>().PlayerWeaponsComponent;
    2. StartCoroutine(playerWeapons.SelectWeapon(1)); // Use weapon 1.
     
    llJIMBOBll likes this.
  9. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    Thank you very much for your response! It works very well if I have it in Start, but it fails me in my script, I tell you

    This is the script I am doing for when I have an object of my inventory visible in my hand, select a specific RFPSP weapon, if it is hidden, select the weapon! Unarmed

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class testweapons : MonoBehaviour
    4. {
    5.     public FPSPlayer FPSPlayerComponent;
    6.     public GameObject actWeapon;
    7.  
    8.     void Start()
    9.     {
    10.         //FPSPlayerComponent.PlayerWeaponsComponent.GiveAllWeaponsAndAmmo();
    11.         //var playerWeapons = FindObjectOfType<FPSPlayer>().PlayerWeaponsComponent;
    12.         //StartCoroutine(playerWeapons.SelectWeapon(1)); // Use weapon 1.
    13.     }
    14.  
    15.     // Update is called once per frame
    16.     void Update()
    17.     {
    18.         if (actWeapon.activeInHierarchy == true)
    19.         {
    20.             OnEnable();
    21.         }
    22.         else if (actWeapon.activeInHierarchy == false)
    23.         {
    24.             OnDisable();
    25.         }
    26.     }
    27.  
    28.     void OnEnable()
    29.     {
    30.         var playerWeapons = FindObjectOfType<FPSPlayer>().PlayerWeaponsComponent;
    31.         StartCoroutine(playerWeapons.SelectWeapon(1)); // Use weapon 1.
    32.     }
    33.  
    34.     void OnDisable()
    35.     {
    36.         var playerWeapons = FindObjectOfType<FPSPlayer>().PlayerWeaponsComponent;
    37.         StartCoroutine(playerWeapons.SelectWeapon(0)); // Use weapon 1.
    38.     }
    39. }
    If I delete // and leave only what I have in Start, it works fine, the Player appears with the knife in my hand and there are no failures

    but if I leave the script as I have it, it gives me bugs.

    NullReferenceException: Object reference not set to an instance of an object
    testweapons.OnEnable () (at Assets/scripts/testweapons.cs:31)

    transform.localPosition assign attempt for '!Unarmed' is not valid. Input localPosition is { 0.000000, -Infinity, 0.000000 }.
    UnityEngine.Transform:set_localPosition(Vector3)
    <SelectWeapon>c__Iterator1:MoveNext() (at Assets/RFPSP/Scripts/Weapons/PlayerWeapons.cs:618)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

    oroutine couldn't be started because the the game object 'testscripts' is inactive!
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    testweapons:OnDisable() (at Assets/scripts/testweapons.cs:37)

    I can't think of how to solve this,
    could you indicate that I'm doing wrong please

    Thank you!
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @sebasfreelance - I'm not sure what you're trying to do. I recommend letting Unity call OnEnable and OnDisable automatically; don't call them yourself. (You may want to rename those methods or merge them into a single "SetWeapon" method.)

    Try calling StartCoroutine(playerWeapons.SelectWeapon(#)); only when you need to. Also check if playerWeapons is null first.
     
  11. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    240
    yesterday I was hitting the wall all day long :(

    but finally I got what I wanted! :)

    Thank you very much for your help, it has been very useful

    Best Greetings
     
    TonyLi likes this.
  12. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Hey programmers in the group. I've just discovered the logs and am seeing this error. (I'm not a super programmer) How would I go about tracing this back? I'm not sure what exactly the error is.... It looks to be third person weapons and/or maybe the recticle.


    (Filename: Assets/RFPSP/Scripts/Weapons/WeaponPivot.cs Line: 119)

    NullReferenceException: Object reference not set to an instance of an object
    at WeaponPivot.Update () [0x00001] in C:\unity_working\9-27-1029\rewired_test\Assets\RFPSP\Scripts\Weapons\WeaponPivot.cs:119


    Edit: Follow up. I have "crosshair enabled" checked off in FPS player script. When I turn that on, the error goes away... but zoiks! I don't want the crosshair enabled!
     
    Last edited: Oct 8, 2019
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @jons190 - Assuming we're looking at the same version of RFPSP, that line is:

    WeaponBehaviorComponent = PlayerWeaponsComponent.CurrentWeaponBehaviorComponent;

    This means PlayerWeaponsComponent isn't assigned. The script's Start() method assigns PlayerWeaponsComponent the value of CameraControl's playerObj.

    Inspect your Main Camera's CameraControl component. Make sure FPS Player is assigned to Player Obj.
     
  14. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    -----------------

    Yes it is. seems to be something with the recticle. I've been playing around with that and somehow must have twarged something... not sure what or where.... (usually when these errors pop up, I just copy my fps prefab from a level that has no errors and replace it on the level that is throwing errors to fix. I rarely know how to fix these type of things although my approch doesn't seem to "programmy" but hey... it seems to work...)
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hey, if it works, don't knock it. :)

    Sorry I can't help any further. All I can say is that, at the time that it throws that error, the WeaponPivot script's PlayerWeaponsComponent variable is null.
     
    jons190 likes this.
  16. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Alright, for those that are still around. I need some advice. I need to pause the game automatically, when a VR headset is taken off and then restart on vr headset on I have the code that will initiate the pause in OVR MANAGER. But I'm such a duwb programmer, I'm not sure of the best course of action to initiate the pause.


    Somewhere int eh code, there must be a pause function. Does anyone know that location? I'm going to go line by line today, but maybe someone already knows where that is. In FPS input, I have found this line:

    pausePress = ExtraInput.GetButtonDown("Pause");

    But what little I know of programming, tells me, that this is just the button code to initial the pause function and I have to find the pause function in the code and then set something along the lines of
    Pause = true
    Pause = false

    Or something to this effect.

    Also, I am thinking that maybe a better/secondary "architecture" for this would be to freeze the delta time and then unfreeze on pauses end. (which maybe will be exactly the mechanism I find, once I sleuth out the pause function)

    Anyway, any thoughts from a more experienced programmer, would be welcome. Cheers mates! Long live RFPS!


    Alright: In FPSplayer I have found this gem at line 508


    }
    if(Time.timeScale > 0.0f || paused){
    if(!paused){
    menuTime = Time.timeScale;
    }
    Time.timeScale = 0.0f;
    }else{
    Time.timeScale = menuTime;
    }

    This look menu specific, but looks like the start of what I need to access.....
    There also seems to be this method (?????) up on line 189

    FPSPlayer.pauseTime

    that just might be the thing I need to call and set true and untrue. Here goes some trial and error!
     
    Last edited: Oct 11, 2019
  17. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    302
    Anyone tried neoFPS

    Does the gun feel realistic like RFPS?
     
  18. scorpionassassin

    scorpionassassin

    Joined:
    Apr 16, 2016
    Posts:
    1
    hi guys,how to change or make reload anim camera??iI tried, but it didn't!!!
     
  19. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Hey quick question. What was the last official RFPS version. I have 1.43, but I thought the last one was 1.47????/
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    The last version appears to be 1.45, released December 17, 2018. The release notes for 1.44 - 1.45 are:

    1.45:
    • Fixed underwater surface shader.
    • Added NpcDamage var to DamageZone.cs to gradually apply damage to NPCs while in damage trigger.
    • Fixed origin of bubble particles firing effect.
    • Fixed player character rigging for new Unity versions.
    • Removed legacy image effects (except sun shafts) and replaced with Unity Post Processing Stack.
    • Fixed bullet shell rotations.
    • Fixed fired arrow velocity.
    1.44:
    • Fixed missing Project Settings in uploaded versions.
     
    OZAV likes this.
  21. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Zoiks! I don't have this package. Trying to download now from the store, but not having luck!
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    In the Unity editor Asset Store window, you should be able to go to My Assets and look up RFPSP. From there, you can update and import.
     
    OZAV likes this.
  23. F0GZ

    F0GZ

    Joined:
    Feb 22, 2018
    Posts:
    33
    If someone interested in my game based on RFPSP, so... here my last devlog :)

     
    owyang, jons190, OZAV and 1 other person like this.
  24. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    ... so good to see, 15 Nov, 2019, everything still runs, with all the members quality, some topics and assets will never get old, keep the information and good work, guys. RDA-AlienMoon-View-02.JPG
     
  25. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    ... Purchased on Steam, to support, the $2.95 price is too low, you should definitely up to at least $5 :).
     
    JamesArndt likes this.
  26. F0GZ

    F0GZ

    Joined:
    Feb 22, 2018
    Posts:
    33
    thanks for buying 03.04 :) i think its good price for that quality.
    Also, the game on video is "Everyone Dies". It will be on steam too, i think. in january 2020
     
    OZAV likes this.
  27. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    ha. It worked. for some reason my unity store page, sloooooowsssss down to like x286 speeds when I get intot he store. but i managed to pull it down! whooot!
     
    TonyLi likes this.
  28. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    I am surprised to see that the forum for RFPS is still active! Best asset ever. Created and published my first FPS using it. Anyway, I'm thinking about starting up my next one with it but never figured how to replace the character or animations. Does anyone have a good reference/ideas on how to do this?
    I was really excited to see the updates made by @FOGZ Let me know how I can the addons.

    @ToniLi Maybe this was asked before but if I could pry, why was this asset abandoned(deprecated) ?
     
    Last edited: Nov 25, 2019
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    I'm not the developer of RFPSP. But I suspect the developer just didn't have time to keep it up to date with the latest versions of Unity. I don't really know, though.
     
  30. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    Sorry about that. It seems as if this is still pretty active. Is there a GitHub location for community updates/extentions or such?
     
  31. F0GZ

    F0GZ

    Joined:
    Feb 22, 2018
    Posts:
    33
    I suppose I post my projects too often here, sry about that. But if you are interested in my new game made on RFPSP, then welcome: fb.me/jpegofpain

    P.S.: I will try not to bother you here :p

     
    jons190 likes this.
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @F0GZ I like seeing your posts and watching the progress. Keep it up!

    @jnbbender - No worries! I try to stay active on the thread here since I'm still supporting the Save System for RFPSP. I don't know of any github repo. Feel free to start one.
     
  33. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Nice stuff. I to do zombies in my game. Where did you get those slick models?
     
  34. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    There are few vids floating around from earlier version and some info int he forums. my understanding is changing the weapons is a pain, but can be done. I have to swap out a few in my game, but have been putting it off... but it's about time to learn..... If I figure anything out, I'll post some info. Cheers mate!
     
    jnbbender likes this.
  35. F0GZ

    F0GZ

    Joined:
    Feb 22, 2018
    Posts:
    33
    Studio New Punch zombie models. Check it on asset store (around 20$)
     
    jons190 likes this.
  36. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    2018.4lst, but now I see what you were saying...
     
  37. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Alright folks. Bear with me as I am not hte best C# codered.

    So I am looking for the "moment code" in RFPS so I can swap it out with the OVR code for VR controllers.


    Is this the code: Located at line 189 in the Inputcontrol.cs script?


    //scaled radial deadzone for joysticks for smooth player movement ramp from deadzone
    moveInput = new Vector2(Input.GetAxis("Joystick Move X"), Input.GetAxis("Joystick Move Y"));
    if(moveInput.magnitude < deadzone){
    moveInput = Vector2.zero;
    }else{
    moveInput = moveInput.normalized * ((moveInput.magnitude - deadzone) / (1 - deadzone));
    }

    lookInput = new Vector2(AccelerateInput(Input.GetAxis("Joystick Look X")), AccelerateInput(Input.GetAxis("Joystick Look Y")));
    if(lookInput.magnitude < deadzone){
    lookInput = Vector2.zero;
    }else{
    lookInput = lookInput.normalized * ((lookInput.magnitude - deadzone) / (1 - deadzone));
    }
     
  38. TheChairMaster64

    TheChairMaster64

    Joined:
    Aug 9, 2016
    Posts:
    59
    So i have two questions...

    1. Is it possible to have multiple shoot/melee animations for enemies that they can choose randomly

    2.Lets say im in one scene and i flick a switch/touch a trigger would it be possible to have that trigger activate or deactivate a object in another scene (example a door in a hub world)?
     
  39. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    109
  40. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    1) yes. There is some psudo code on this tread about this exact thing. (a feature I want to implement as well, so if you come across a solution, shout out)

    2) yes, but this will be done outside of the rfps assets. You'll have to set up some sort of code for this. I think tony Li's Quest system, has exactly this type of functionality and works great with RFPS.
     
  41. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Not sure. I know some folks were implementing a inventory system in this thread (you'll have to look back through to find details) but am not sure it's supported any longer....
     
  42. GWStudio

    GWStudio

    Joined:
    Sep 27, 2016
    Posts:
    109
    yes i saw them but this is the best inventory system for Shooter game it have the best customization system .. anyway I hope someone do integration with it.
     
  43. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    @TonyLi

    Hey Tony, was just sitting down to start incorporating the diolog system into my next game. I see its at 2.2 and the demo is for Unity 2019. Will it still work with Unity 2018.4 LTS and rfps 1.44?

    I'm just after super simple stuff like "get the key to t open the door" and"kill the boss monster to progress to the next level" type o stuff.
     
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @jons190 - Yes, it works fine with RFPSP 1.44 and Unity 2018.4. The Dialogue System officially works with all Unity versions 2017.4 and higher, and unofficially with Unity 5.3 and higher.
     
  45. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260
    Excellent. Downloading now and getting it set up. If I remember right, the exact kind of quest I needed was already set up in your examples. "get key, open door" and I remember some sort of "collect three things and open door" type of quest.... from the last time I played with it.

    Also, I was just reading your website. There is a "plugin" for VR text? I do Oculus VR deving, so I will need this plugin in as well you think? Cheers mate and happy holidays!
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    It's not a plugin per se. The Dialogue System Extras page has some example scenes in which the dialogue UIs are set up for VR interaction. Those example scenes do use different plugins such as Unity's VR Samples package or Valve's OpenVR plugin. But you don't have to use them. If you already have a way to interact with UIs in VR, you can do the same with the Dialogue System since it just uses regular Unity UI.

    Happy holidays!
     
  47. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260

    hummm. trying to do a clean build today... Keep getting major errors.
    repro:
    unity 2018.4.6f1 LTS, RFPS 1.45, dialog system 2.2 eval

    (1)import rfps 1.45 (all is well)
    (2)import ds 2.2 and it throws errors.

    upload_2019-12-3_16-23-37.png


    But yesterday I imported the DS into an existing project THEN imported RFPS and was not sure I saw these errors.....

    Zoiks!
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @jons190 - If you have a paid version of a Pixel Crushers asset, such as the Save System for RFPSP, delete this folder:

    Assets/Plugins/Pixel Crushers/Common/Scripts

    and make sure the DS eval version imports this file:

    Assets/Plugins/Pixel Crushers/Common/DLLs/PixelCrushers.dll
     
  49. jons190

    jons190

    Joined:
    Sep 13, 2016
    Posts:
    260

    Yes I do runt he paid version of save system.

    So update: I set my build settings to :
    Android
    and then set the build backend to
    .net 4.0
    and this seemed to do the trick. No pathing errors. but now I get input errors (axis not set up) which I think is on my end, since I am doing lots of funcky stuff with the inputs to get it all to work in VR.

    But I will experiment with these steps and see what transpires....
    I was laying with it last night and think this all has EXACTLY the features I wanted. I wanted to add some sort of "character builder" and think I can achieve a bit of this with the Quest log by showing this screen in my transitional scenes between levels. Then structure my quests like:
    YOu have found three of the four skulls and you attack rating is +10%.
    Youhave found the ring of power + 2 on damage given..
    ect.

    So I may havve some questions the next few days as I try and set this all up. Cheers mate!
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @jons190 - This page shows the input axis settings that you need to set up for Unity UI. (The Dialogue System integration assumes that the project is ready for Unity UI.)

    That's a good idea!