Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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:
    332
    Hi closetgeekshow,

    You Do? Thanks

    :)

    I am Now on Major Update 5 of game levels and am Publishing and testing as I go. I will have some news soon regarding a game release of some kind, though I have not yet decided what to do with it. I may release it as early access on Steam or elsewhere or not :)

    I will post a more comprehensive Update overview as soon as I am able.

    Grab 20220927170052 w1360h768 x1917y-211z1507r227.jpg

    Grab 20220927171554 w1360h768 x1920y-211z1472r245.jpg

    Kindest regards

    Peter
     
  2. Franciscotx56

    Franciscotx56

    Joined:
    Feb 8, 2019
    Posts:
    22
    Hi, I'm adding Hit Animations when NPCs take damage and I'm almost done but the only problem is that I can't stop the NPC.
    this part of the code I'm using is supposed to stop the NPC but it's not working

    Code (CSharp):
    1.   speedAmt = 0.0f;
    2.   SetSpeed(speedAmt);
    3.   agent.isStopped = true;

    does anyone have any idea what is wrong?

    my two functions are:


    Code (CSharp):
    1.     public void HitReaction()
    2.     {
    3.         if (CharacterDamageComponent.hitPoints > 0.0f)
    4.         {
    5.             AnimatorComponent.SetBool("Hit", true);
    6.             AnimatorComponent.SetBool("Idle", false);
    7.             speedAmt = 0.0f;
    8.             SetSpeed(speedAmt);
    9.             agent.isStopped = true;
    10.             StartCoroutine(HitNo(waitTime));
    11.             vocalFx.Stop();
    12.             vocalFx.volume = 1.0f;
    13.             vocalFx.pitch = Random.Range(0.94f, 1f);
    14.             vocalFx.spatialBlend = 1.0f;
    15.             vocalFx.PlayOneShot(HitSound);
    16.         }
    17.  
    18.  
    19.     }
    20.     IEnumerator HitNo(float waitTime)
    21.     {
    22.         yield return new WaitForSeconds(waitTime);
    23.         agent.isStopped = false;
    24.         AnimatorComponent.SetBool("Hit", false);
    25.         AnimatorComponent.SetBool("Idle", true);
    26.     }
     
    Last edited: Oct 26, 2022
  3. Franciscotx56

    Franciscotx56

    Joined:
    Feb 8, 2019
    Posts:
    22
    I managed to solve it by stopping the NPC:

    Code (CSharp):
    1.  runSpeed = 0.0f;
    2.  walkSpeed = 0.0f;
    then I created two variables with the same original running and walking speed and made the NPC run or walk again after the Hit Animation

    Code (CSharp):
    1. runSpeed = newRun;
    2. walkSpeed = newWalk;
    here the final code:

    Code (CSharp):
    1.     public void HitReaction()
    2.     {
    3.         if (CharacterDamageComponent.hitPoints > 0.0f)
    4.         {
    5.             AnimatorComponent.SetBool("Hit", true);
    6.             AnimatorComponent.SetBool("Idle", false);
    7.             runSpeed = 0.0f;
    8.             walkSpeed = 0.0f;
    9.             agent.isStopped = true;
    10.             StartCoroutine(HitNo(waitTime));
    11.             vocalFx.Stop();
    12.             vocalFx.volume = 1.0f;
    13.             vocalFx.pitch = Random.Range(0.94f, 1f);
    14.             vocalFx.spatialBlend = 1.0f;
    15.             vocalFx.PlayOneShot(HitSound);
    16.         }
    17.  
    18.     }
    19.     IEnumerator HitNo(float waitTime)
    20.     {
    21.         yield return new WaitForSeconds(waitTime);
    22.         runSpeed = newRun;
    23.         walkSpeed = newWalk;
    24.         agent.isStopped = false;
    25.         AnimatorComponent.SetBool("Hit", false);
    26.         AnimatorComponent.SetBool("Idle", true);
    27.     }
    so I managed to put Hit Animations and the enemies were much better!
     
    Last edited: Oct 26, 2022
    yuvsv47 likes this.
  4. poison77

    poison77

    Joined:
    Dec 24, 2013
    Posts:
    40
    Awesome Franciscotx56 :) did you add that code in AI.cs or CharacterDamage ? Or its a new script?
     
  5. Franciscotx56

    Franciscotx56

    Joined:
    Feb 8, 2019
    Posts:
    22
    Hello Poison Games, I'm your fan ;))
    in AI.cs but I also added another code in CharacterDamage.cs to call this Void and other logic.
    I will send you an email with more details.
     
  6. ProBrStalker

    ProBrStalker

    Joined:
    Aug 20, 2017
    Posts:
    63
    Good evening guys, I'm on a very important project that I intend to release on this forum as soon as I've finished most of it, and I'd like to know which line of code, states and entries are responsible for all third-person animations and body movements? I looked at the code, but I didn't understand it very well, maybe because it uses a lot of references... I honestly don't know, can someone tell me or extract the part of this code?
     
  7. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    260
    Hello, assuming you have version 1.44 to 1.45 (as last time updated), you can - perhaps: start by clicking on "VisibleBody" player sub-object (child object), than - expand in the inspector "PlayerCharacter" script, that manages it. You should see in the script: "FpBodyController' line, at the top of script normally. So double click on that controller, and it will open animation controller window for you, where all animations and states are listed there. From there, in that animation graph window, as you see - you should have the good idea to explore how everything is arranged inside, including how animations for those states are exactly arranged and managed. RFPS-PlayerVisibleBodyAnimFSM's.jpg
     
    ProBrStalker likes this.
  8. yuvsv47

    yuvsv47

    Joined:
    Nov 2, 2022
    Posts:
    12
    Hello friends!
    Can you please tell me how to make the capture of weapons and ammunition automatic?
    That is, using collision, not control buttons.
     
  9. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    260

    Hello, you can rather use the distance based method. While collisions / triggers method for triggering pickups is not the best and should be avoided, performance-wise. Here, we have attached a .zip, for a community share, of our own made pickup script for health, based on which learning you can duplicate the method for your all other auto-pickup option scripts, for other pickup types. It's with the auto-pickup option as a tickable bool, for yes or no, and it also has coded-in the gamepad vibration functionality as well, for those who have the needed DLL's in your Plugins folder, which method is also explained in the (top of the script section) comments. This is not Azuline Studios script, but it's better-than, for this purpose, that we have made under the same name, and that we use in our projects. You can rename it to any script name you want as well. Credits: OZAV Intnl, for the places where you want to do that ingame, is all you need to do in return, while we hope it helps in this case, or any other similar cases, where better-than Azuline pickup funtionality and options are needed. It's for the health pickup, but once learned from the script - the method can be eaisly duplicated for other pickup-type scripts, such as weapon pickups and similar :).
     

    Attached Files:

    Last edited: Nov 2, 2022
    yuvsv47 likes this.
  10. yuvsv47

    yuvsv47

    Joined:
    Nov 2, 2022
    Posts:
    12
    Thank you so much! I'll have to try this, and then if anything is not clear, I'll ask for help! Thank you! :)
     
    OZAV likes this.
  11. yuvsv47

    yuvsv47

    Joined:
    Nov 2, 2022
    Posts:
    12
    What is the latest version of Unity with which RFPSP works?
    And what version of Unity is recommended?
     
  12. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    260

    Hello, the best recommended with the asset, as we have experienced with the asset - is 2017.4 (LTS). And the asset works on the many of the newer versions as well, while we don't recommend 2018 versions due to different (broken-structure) prefabs system and a lot of instability and bug behaviour related to 2018 versions. It's also a matter of your experimenting in the many past-2018 versions as well, to find what works the for you and your pipeline you want to setup, if you don't want to stay at the best proven version with the asset, which is 2017.4+ LTS versions:).
     
    yuvsv47 likes this.
  13. yuvsv47

    yuvsv47

    Joined:
    Nov 2, 2022
    Posts:
    12
    OZAV , thank you for your reply! In that case, I'll install the 2017 version as well.
    Although the 2018 version I have installed now works great with this great package. Of the problems I saw only one: - the robot cannot make a jump following the NavMesh-Link. I may be doing it incorrectly, though.
    RFPSP is a unique set. There is so much work done in it that its individual parts could be sold independently of each other! :)
     
    OZAV likes this.
  14. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    332
    I am using Unity 2021.3.4f1 LTS with RFPS for my game. I will update the version again always looking for a better one (some hope).

    Earlier Versions than I use are probably less complex and thus potentially pose less issues....Less to go wrong....simple is good in some ways :)

    If you are happy with a Version and it works for you best stick with it perhaps.

    Despite Unity versions always having seemingly endless known issues and problems for us devs to contend with it works for me in the final outcome.

    I am publishing my game with it too and can successfully build my game of currently 20 fully working levels which seem to be fine as far as my particular version is concerned.

    Kind regards all

    Peter
     
    yuvsv47 likes this.
  15. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    260
    Unity 2017 4.4+ (LTS editions) is stil lthe best and quickest to work with, and it has 3 to 5 times faster production time over the new versions, so you will loose a less of your vision and lifetime than using the later versions. It also has not any of the 'locked prefabs' administration nag features that will additionally cost you hundreds of hours of your vision, sleep and lifetime on top of that. We highly recommend 2017 4+ LTS editions from that reason, and perhaps when you are up to very publishing point - than upgrade to, 2020'es and newer and do just the publishing from there, since new versions are just not a healthy versions as it used to be, from the times when they still cared for the community and: productivity. While 2017's LTS'es still do the same as 'new' verisons do, so it goes up, for our vote on the subject, and always remember: not everything 'new' is always good for you - the developer. Same as that 2017 4+ (LTS) verisons should be kept forever, in our best advice to Unity, in paralel, and protected, alongside with 'new' editions, because it makes sense and is healthy for you if you are looking to loose almost no any extra time and vision and be very productive, which should be the main idea, over all the other interests. Experienced developers know exactly what we are talking about here. We have said this 100 times already, and will keep saying it, while the 'new' vesions are still getting only more time consuming, more difficult to work with and more complicated, and while the such no-control aspect currently turns away so many from Unity in the all other engines directions, and we all know it :). RDA-BlackSunBase2Map_10.jpg
     
    yuvsv47 likes this.
  16. yuvsv47

    yuvsv47

    Joined:
    Nov 2, 2022
    Posts:
    12
    OZAV, good afternoon!
    Which one? - 2017 4.4 or the latest 2017 4.40 version?
     
  17. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    332
    Hi Ozav,

    I would agree with you 100% regarding the latest versions that I am currently using in that they have a lot of issues particularly relating to those details you have outlined correctly. Indeed they have and constantly hinder my progress with those issues you mentioned and some of them are quite a serious hindrance to us indies who have little time to waste. The version I am using has prevented my from getting on finalising my publishing of a full 26 level version of my game for release. I got stuck on Updating just one level 20 for I dont know maybe 5 weeks lost to issues with Unity.

    And these issues it has keeps throwing up more problems every day I have to fix. Today it was some Doors dont function at all any longer so one gets stuck in the game. Next it was a serous one. Unity is now preventing me saving changes or additons to my "Global" "Player Characters" Prefabs so I will have to edit all such occurances manually throughout the whole game. Its worse as my Players Trigger many "Triggers" throughout the game and that means thousands - Triggered by use of "Trigger by Tag" which means I may have to find and manually adjust all those too. I have had issues in the last few days too with Cursors, Pointer, Pause Functions, Menus and more, and more issues yet to find I am sure to come at a time when I was almost looking to complete the First Episode of my game :)

    Still I have now I think found fixes and ways to Update that get around these issues but it has cost me a lot of time and money "Yes" and as you point out lack of sleep and life on the edge of insanity ;-) Its no joke and not funny....

    Having said that though Unity complains all of the time at what I am doing It all still works apparently! It tells me that the Player all of a sudden has things like scripts and other additions I have recently made that are not "Legal" as it were - well bugger you I am getting on and the game works and plays better than it did previously :)

    That is perhaps Until I publish again and nothing works :)

    2.40am now and have been at it since 7.00am yesterday so just few hours sleep (4maybe ) shortly and I will be back at it again at 7.00am for a full day of pain and agony again.....

    If it was anyone but myself I would say listen to OZAV he has good advice.

    Ah! almost time I updated Unity Again Oh and UMA and what joys all that may bring Eh!

    Good Night and happy Game Making.

    Regards

    Peter
     
    OZAV and yuvsv47 like this.
  18. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    260
    Hello, if staying in the any range you mentioned, but with 2017.4 's in general - it does not matter that much - you will be just fine. We prefer to stick with the 2017 4.4 onward LTS (from long term support 2017) versions, but it's just our preference. So it's a good practice to hang for downloads at - Unity download archive page, and pick the 2017's (or even better 2017 's LTS from there), and you can also download any current versions while right there, whatever suits, on the day. Just follow / save the link, everyone, for all who need it :). https://unity3d.com/get-unity/download/archive

    RDA-Nieuport28-ParkingBrakeSet04.jpg
     
    Last edited: Nov 15, 2022
    yuvsv47 likes this.
  19. yuvsv47

    yuvsv47

    Joined:
    Nov 2, 2022
    Posts:
    12
    Thank you, OZAV.
    I, by the way, thought the range from version 5 to 2018 was optimal. :)
    Now I downloaded 17.4.4 for my collection to see.

    Peter, I honestly don't see the incentive to spend time on the latest versions of Unity just because of the new packages.
    A good editor turns into a pile of settings for endless learning of the editor itself, rather than for efficient use of it.
    Yeah, I can't afford Unreal, because of weak hardware. But I can see that the features of the Unreal system that Unity is trying to keep up with end up steadily leading Unity to more failures. The number of defects and failures is steadily increasing.
    Imagine if Windows worked like that! o_O
    So, no.
     
    OZAV likes this.
  20. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    332
    Yeah,

    Talk about weak hardware my system is rubbish. I use a Laptop and have only just bought a new free standing monitor. to attach to it so I can look at something larger than a postcard size window to edit in :)

    However my game when published is running at speeds that are well playable at high quality even on my rubbish system - probably due to whoever knows what on the Unity engine side but I use a Frame Rate Manager and have optimised the heck out of the game.

    Kind Regards all

    Peter
     
    OZAV likes this.
  21. kikoukop

    kikoukop

    Joined:
    Dec 29, 2011
    Posts:
    15
    Hi, Why don't the buttons on the canvas work with Realistic FPSP?
     
  22. petercoleman

    petercoleman

    Joined:
    Feb 21, 2016
    Posts:
    332
    Hi kikoukop,

    Along with other things users may indeed find that UI buttons do not function in recent versions of Unity.....

    As far as I am aware this is a known issue amongst at least some people/users using Unity as I have read so over the internet.....and it has been an issue I have had to deal with myself which can make a project unuseable if your project relies on such things as Menus or other features which rely on interaction with UI buttons....furthermore this issue also could have an impact on any features and functions which require the use of the following which may be impacted also....any items with a Pause feature, items that require the use of a Cursor and or Pointer...the use of keys on your keyboard Esc and Tab or any other alternative Key you may use to Pause or Esc the game or game feature.....

    In a game for example like my own there may be numerous or indeed many features/functions/assets which require a Pause state to be called while interacting during a game...

    This seems to be a complicated issue related to various things e.g. in particular a Cursor, a Pointer as they behave in interaction (or not) with the previous mentioned things above and additionally the issue is also relative to the cursor and or pointer "States" : is Visible or Not, Is Locked or Not and these Cursor States may also be called or be affected by numerous or many assets features or functions you may have in embedded in your game content....

    Unfortunately it does seem to be complicated and is seemingly a Unity Issue which takes it upon itself to "Hide" and or Disable/Lock the Cursor/Pointer which can not have one "State" and at the same time have another. In most instances for instance calling up say a Menu in your Game requires the Game to be Paused while you interact and for that you Need a Pointer/Cursor to click a Button and so on and when you need it you may find you dont have one either visible (In Focus) or which is not Locked and is Functional.

    I am not sure if it is also linked to or telated to the Windows Pointer State as Unity does rely on some things linked to the OS Platform being used by the Game I believe. I am also not sure if the New Unity Input System is a culprit.

    I had my game project taken out by this issue and a number of other issues recently which I have recovered from Just about but which required a major intervention in changing and replacing numerous things in my Game which I am not too happy about having been forced into it and lost a great deal of forward development time in the proces also.

    There is some information on the internet about these things which is not particularly helpful to mere mortals and as said though I have a working project again now I am still left with unwanted issues which are not show stopping but however cause some inconvenience to an end game player when switching from the game Paused state and back again when in some case it is necessay to press ESC or Tab to refocus the Pointer....

    I would suggest that if your Buttons and or Pointer are not working you could try pressing the Pause, Tab or Esc key (testing one at a time perhaps) to see if that helps and brings the buttons to life.

    I am sorry I dont know of a simple fix or answer to this issue which is potentially a very serious one.....for users.

    Perhaps someone with more knowledge of such things could help us all?

    Kind Regards

    Peter
     
    Last edited: Nov 25, 2022 at 11:01 PM
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,149
    Does your scene have an EventSystem?
     
  24. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    260

    ... Noted ... The worst thing you can do to a community and engine is: try to simulate / impersonate other engines and their admin-nag useless features, thinking it's a 'smart and cool' thing to do) * If they want the community to hang around and spend on the assets, we can forgive them everything that happened from 2017 LTS'es, since from v.2018 - that is not Unity, and - as we all agree, as obvious. Meantime - we should perhaps vote out everything that happened from 2017 LTS'es, and will be good to see it organised, so that we all have a link where we can all vote it out. The worst thing about it ? We are all correct here. Because the whole community thinks that way, but we at least: we do discuss where exactly the everything is going, with our thanks to all who follow up on it, as you are true & genuine Unity users. Our input, and well being (as the members / users / customers): matters, and - it should matter, so for our vote we - the long years users will say: it should matter as the first, and only than - everything else, and not only the one-way 'improvements' with the community not being able to use it in a healthy way, or publish anything, with all that 'progress' around. WIth this - we will have no our name in it. Give us the true Unity, for what it was, prior being 'progress' hijacked, or nothing. So, for now - we are docking at 2017's, thanks :).
     
    Last edited: Nov 26, 2022 at 2:16 AM
    yuvsv47 likes this.
  25. kikoukop

    kikoukop

    Joined:
    Dec 29, 2011
    Posts:
    15
    Thanks for the info petercoleman
    Yes, TonyLi, it has EventSystem. I need it to work in the initial scene, where the menu, options, etc. are located. It is a separate scene from the game.
     
unityunity