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.

[RELEASED] DarkTree FPS system

Discussion in 'Assets and Asset Store' started by DarkTree, Mar 29, 2019.

  1. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Actual changes and new features list.
    - Player body now have turn parameter and standing animation. When you turn camera, player move legs too.
    - Grid inventory with custom items size. Have a great potential. Created by me from blank. Stacking/unstacking, equipment slots, mobile support are included
    - New equipment system. Items and weapons are not separated anymore. They sharing same item class. But inspector drawsdifferent fields depending on item type. You can create equipment slots to put items with specific ID or type. Also you can get equipped item from slot if this one exists (for scripting).
    - Additional shot animation fields.
    - New sway, lean, camera settings
    - New animation state for pickup event. When player look at item, we can call animation where player's hand pointing to item. Looks fun.
    - Item wizard
    - licensed 3 new weapon models with rigged hands. Removed old ugly models. Also made new animations. Looks great
    - New scope system. We won't use ui scope image. Now we have real scopes. Easy to setup
    - Started weapon attachments feature. We can attach scopes and silencer to our weapon. Feature will be the same as in the stalker. (Thilon request)
    - Building and gathering system. Collect resources and build something. Each building is a simple scriptable object. Very easy to use.

    Thing I left to do before release.
    - Remake save/system
    - Make new grenade system
    - Want to make NPCs be independent of player and create fractions but not sure that have time now.
    - A lot documentation!
    - Polish inventory.
    - Write auto sort for inventory.
    - Scene transitions without data loss
    (Mad_Mark request).
    - Shotgun?

    If I forgot something I promised, feel free to tell me what.

    Thanks for your patience!
     
    qwerty_LS, M_J-Gaming and scarfell like this.
  2. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Also fixed bugs. For example, bug with crouch jump etc.
     
  3. scarfell

    scarfell

    Joined:
    May 16, 2017
    Posts:
    10
    Nice work!
    I'm really looking forward to the update
     
  4. Thilon

    Thilon

    Joined:
    Jul 23, 2012
    Posts:
    10
    Well done Sir! Keep pushing! :)
     
  5. M_J-Gaming

    M_J-Gaming

    Joined:
    Jun 11, 2019
    Posts:
    7
    I am having some trouble with when i add post processing on to the game prefab when arms move out when I go to pick up a gun i am using Unit 2019.2.0f1.
     
  6. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Can you show how it looks like? Any errors in the console appears?
     
    M_J-Gaming likes this.
  7. M_J-Gaming

    M_J-Gaming

    Joined:
    Jun 11, 2019
    Posts:
    7
    sure just give me a min
     
  8. M_J-Gaming

    M_J-Gaming

    Joined:
    Jun 11, 2019
    Posts:
    7
    eroor.PNG Capture.PNG
     
  9. M_J-Gaming

    M_J-Gaming

    Joined:
    Jun 11, 2019
    Posts:
    7

    also this
    erooer.PNG
     
  10. M_J-Gaming

    M_J-Gaming

    Joined:
    Jun 11, 2019
    Posts:
    7
    erere.PNG
     
  11. M_J-Gaming

    M_J-Gaming

    Joined:
    Jun 11, 2019
    Posts:
    7
    I also get all of these errors when i start a new project
     

    Attached Files:

  12. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    It's seems that you missed some import settings. Import in empty project and delete post processing folder
     
  13. M_J-Gaming

    M_J-Gaming

    Joined:
    Jun 11, 2019
    Posts:
    7
    When i try to use my own Post Processing effects if make the arms look infront of me
     
  14. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    You trying your custom post processing effects? Made by you? All I see on the pictures is camera fov shifted to about 60-70, but it must have 35 value. Also, you should delete old post processing imported with package!!! There's could be a reason why your case works wrong
     
  15. Thi_Tran

    Thi_Tran

    Joined:
    Sep 26, 2019
    Posts:
    1
    Guys I need some help. I downloaded the Free version of the game but I am struggling to make my enemy AI damage the player and the player damage the AI. I used another enemy model and got most of the patrolling and tracking the player right but when the AI attack it does no damage. Since DarkTree fps have its own player stats and damage scripts it is really hard to figure out how to integrate my own scripts to work with the AI I imported elsewhere. Any guide guys?
     
  16. mazz42

    mazz42

    Joined:
    Jul 7, 2019
    Posts:
    1
    Can someone help me adding multiplayer ?
     
  17. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    There is applydamage method in playerstats. Call it when you need to hit player.
     
  18. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Often when the player dies, it get stuck in an endless spin. How do I make it stop doing that?
    Haven't made any changes except to delete the post processing.
     
  19. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    As I remember, same behaviour was caused by recoil script, also it could to be lean script. But I think that it recoil in this case.
     
  20. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    The lean script seems to be the issue. I disabled it and got killed several times without the spinning happening. Tried it again with the recoil deactivated and it started spinning on the second death. I'll just keep lean disabled until you can fix it.
     
  21. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    455
    I currently have the Free version to test things out. I did notice it is only at v1.0 and the full version is v1.21. v1.21 has the capabilities I am interested but I just have some additional questions. I can see full body perspective is now implemented, how easy is it to replace the character? how easy is it to replace just the hands? Are there any instructional videos? I would like to use Maksim's Animated Weapons. https://assetstore.unity.com/packages/3d/props/weapons/animated-hands-with-weapons-pack-132915
     
  22. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Hello, you can put any body with mecanim rig. Just remove old body, put new and reassign animator in script. Very easy. However hands are dependent from animation. Each weapon require rig and animation with hands to work right and beautiful. I made new rig and animations for next version so I can say that animating and rigging is complicated a bit but not very hard task at all.

    About Maksim's pack. Yes it will be supported by package. In fact you can put any object as weapon, even cube, cylinder etc. Have you tried to make a new weapons with free version ever? Process in paid version is absolutely identical...
     
  23. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    455
    Have not given it a try yet. I'll give it a go
     
  24. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    476
    You may need to exclude the Post Processing layer from the weapons camera.
     
  25. scarfell

    scarfell

    Joined:
    May 16, 2017
    Posts:
    10
    Any updates on the next version? I'm really looking forward to its release :)
     
  26. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Version 1.3 is out now! Check AssetStore and update.

    Release notes for 1.3:

    -- NPC ---

    - NPC's have headshot zone and body zone
    - NPC's have ability to take covers.
    - NPC's tactical behavior improved.
    - NPC's have fractions now. They can attack each other
    - NPC's can go and check last visible enemy position
    - NPC's idle state modified to give some delay before new movement

    --- Player & Weapons ---

    - New hands rigged and animated with blender. I can send you a rig file if you want. Don't included in the package but send on demand
    - New weapon models
    - Added recoil kick. Now camera move after each shot with defined in settings value
    - Added headbob script.
    - Changed main footstep sound
    - Weapon manager have more smooth weapon change method for now. It must hide old weapon before turn on new
    - Added shotgun.
    - Added interaction animation. When player look at an item, we can push special animation clip on weapon animation controller. Also added take animation. It's working but example is not included (feature is under ???)
    - Added render texture scope to get more realistic feeling of aiming

    --- Inventory & Items ---

    - Drag & Drop
    - Completelly new inventory with grid placement system.
    - Inventory now have special slots to store specific items. Think about it as equipment slots
    - Items and weapons are the same now. In previous version a weapon has different script for pickup interaction. Now it's not
    - Items became stackable! Stack and unstack items by dragging them into one.

    --- Misc ---
    - Added bulding system. Not finished now
    - New editors
     
    Daniel466 likes this.
  27. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
  28. Daniel466

    Daniel466

    Joined:
    Apr 9, 2014
    Posts:
    69
    Darktree do you have discord?
     
  29. jesseganey

    jesseganey

    Joined:
    Apr 26, 2017
    Posts:
    78
    What a great kit. Good work. How do i change the range on weapons.
     
  30. Daniel466

    Daniel466

    Joined:
    Apr 9, 2014
    Posts:
    69
    Its probably on the weapon data scriptable object if im not mistaken
     
  31. jesseganey

    jesseganey

    Joined:
    Apr 26, 2017
    Posts:
    78
    Thanks i will check this evening.
     
  32. Daniel466

    Daniel466

    Joined:
    Apr 9, 2014
    Posts:
    69
    i maybe wrong lol i haven't used since last update that was while ago
     
    jesseganey likes this.
  33. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Think about account making
     
    Daniel466 and jesseganey like this.
  34. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    What do you mean under range? Is max hit distance?
     
  35. jesseganey

    jesseganey

    Joined:
    Apr 26, 2017
    Posts:
    78
    Thanks. This is the best kit ive tried. Cant wait to see where you take it next. Just a suggestion but the free version could use a little love. It doesnt do this kit justice.
     
  36. Bonzotaz1

    Bonzotaz1

    Joined:
    Apr 12, 2014
    Posts:
    115
    Any chance for a mac demo? Really wanna buy this
     
  37. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
  38. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    476
    I just installed version 1.3 into a new project and imported Flooded Grounds.
    I am getting 999+ errors relating to the PlayFootstep animation event and Weapon.cs.

    'Body' AnimationEvent 'PlayFootstep' on animation 'Riffle walk' has no receiver! Are you missing a component?
    'Body' AnimationEvent 'PlayFootstep' on animation 'Run' has no receiver! Are you missing a component?

    NullReferenceException: Object reference not set to an instance of an object
    DarkTreeFPS.Weapon.UpdateAmmoText () (at Assets/DarkTree FPS/Scripts/Weapon/Weapon.cs:1039)
    DarkTreeFPS.Weapon.Update () (at Assets/DarkTree FPS/Scripts/Weapon/Weapon.cs:341)

    I do hear the footsteps, so it is hit and miss. Ideas?
    Mark
     
  39. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    1) Error is caused by a missing weapon item. Weapons are dependent from inventory items now.
    This is due to the need to read the ammo from the item. It seems that you have missed item reference or your weapon object which is turned on start but we get item reference on item pickup. So there is it.
    Code (CSharp):
    1. //Error line
    2. ammoText.text = string.Format("{0}|{1}\n Mode:{2}", currentItem.weaponAmmoCount, CalculateTotalAmmo(), mode);
    To add weapon or object on start use this code
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using DarkTreeFPS;
    5.  
    6. public class AddItemsOnStart : MonoBehaviour
    7. {
    8.     public List<Item> items;
    9.  
    10.     bool spawned = false;
    11.  
    12.     void Update()
    13.     {
    14.         if (items == null || spawned)
    15.         {
    16.             Destroy(this);
    17.         }
    18.  
    19.         var Inventory = FindObjectOfType<DTInventory>();
    20.    
    21.         foreach(var item in items)
    22.         {
    23.             Inventory.AddItem(item);
    24.         }
    25.  
    26.         spawned = true;
    27.     }
    28. }
    29.  
    Put this code somewhere in your scene and set needed items to the items field.

    2) About Footsteps... Walk and run animation clips are used by player and enemies as well. These animations has a special animation event to call footstep event for NPC sfx. But player body still has same events but has not function to play them. Console show this error as critical but nothing happens to worry about. I should create dummy empty listener for this events.

    Sorry for an issues. I hope that my answer was helpful!

    P.S I also promised level transition example but still looking for an easy way to do this. It's harder than I thought due the need to have save ability on other scenes too.
     
    Last edited: Nov 27, 2019
  40. jesseganey

    jesseganey

    Joined:
    Apr 26, 2017
    Posts:
    78
    yes need max hit distance but not sure where to look for ranged weapons.
     
    Last edited: Nov 27, 2019
  41. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Shooting distance is unlimited in fact. You just push rigidbody gameobject with BalisticProjectile component. If projectile meet something then it will be deactivated and pushed back to pool. But if not, each projectile have timer to deactivate object if living time more than allowed.

    Code (CSharp):
    1.  
    2.        ///THIS VARIABLE ->
    3.        private float livingTime = 1f;
    4.  
    5.         Vector3 lastPosition;
    6.  
    7.         public Weapon weapon;
    8.  
    9.         private void OnEnable()
    10.         {
    11.             GetComponent<Rigidbody>().AddForce(transform.forward * initialVelocity, ForceMode.VelocityChange);
    12.  
    13.             lastPosition = transform.position;
    14.         }
    15.  
    16.         private void Update()
    17.         {
    18.             time += Time.deltaTime;
    19.  
    20.             RaycastHit hit;
    21.             if (Physics.Linecast(lastPosition, transform.position, out hit))
    22.             {
    23.                 weapon.ApplyHit(hit);
    24.  
    25.                 gameObject.SetActive(false);
    26.             }
    27.  
    28.             lastPosition = transform.position;
    29.            
    30.             ///THIS INSTRUCTION ->
    31.             if (time > livingTime)
    32.             {
    33.                 gameObject.SetActive(false);
    34.             }
    35.         }
    So you can set living time for projectiles to less values to control distance they being shot approximately.
     
    jesseganey likes this.
  42. jesseganey

    jesseganey

    Joined:
    Apr 26, 2017
    Posts:
    78
    Thank you. This is such a great asset. Also your support is very good.
     
    DarkTree likes this.
  43. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    241
    Integrated Easy Bulding System?
    Main menu and in game menu?
     
    Last edited: Nov 28, 2019
  44. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Was I supposed? I started my own placement system (essential thing in package already, want to record tut soon).

    I think that main menu and game menu are the simplest things that can be done with Unity and I don't take them into account. Thousands tutorials on YouTube.
     
    jesseganey likes this.
  45. BeastlyBeast5129

    BeastlyBeast5129

    Joined:
    Jun 24, 2019
    Posts:
    1
    Hi! I updated your asset to 1.3 or whatever but it was really slow and I had problems shooting and stuff. What should I do?
     
  46. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Show me your console when you enter play mode please.
     
  47. Thilon

    Thilon

    Joined:
    Jul 23, 2012
    Posts:
    10
    Created main menu with SLIM ui ~ 3-4 hours :)



    @DarkTree nice job mate. Keep pushing! :)
     
    stuartdn likes this.
  48. stuartdn

    stuartdn

    Joined:
    Feb 3, 2018
    Posts:
    14
    Hi,

    I love the asset. I found version 1.2 to work really well and it was easy to customise / build upon.

    I was excited to try version 1.3 but I cannot get it to work. Firstly the demo scene is missing lots of objects which means it's unusable.

    Then I try adding the game prefab to a scene but when I do I can pick up objects but am unable to aim or fire.

    Any idea why this might be?

    Cheers,

    Stuart
     
  49. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Hello! You already third person who meet with issues on update. Tell me please, what do you see in the console. I'm almost sure that something missed or broken. By the way, I tested update package before submitting and It worked fine...
     
  50. DarkTree

    DarkTree

    Joined:
    Mar 23, 2013
    Posts:
    239
    Thank you:)