Search Unity

Controller Third Person Templates by Invector

Discussion in 'Tools In Progress' started by Invector, Aug 20, 2015.

  1. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    So what about the Gathering system? Like cutting a tree or mining or fishing?
     
    Last edited: May 18, 2017
  2. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    +1 for that.
    Also Dialog System for Unity Integration would complete this Controller from my point of view.
    Inventory Pro and Dialog System for Unity are pretty important and most used assets.
     
    julianr likes this.
  3. VertexZero

    VertexZero

    Joined:
    May 19, 2013
    Posts:
    26
    Hey guys, great asset! I have one question though. How can I integrate the 3rd person camera to be used with VR Occulus? Thanks!
     
  4. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Probably not, you see the idea is to delivery the core functions of each template, for example:

    Basic > Locomotion, Camera, Jump, Basic Interactions, Moving Platform, etc...
    Melee > Attack, Block, Lock-On, Basic AI, etc...
    Shooter > Aiming system, Shooter Weapons, Cover system, Decal system, etc...

    Specific features like cutting a tree, fishing, crafting, vehicles, execute finish moves, advanced combos, etc... are mechanic that make a game be that game, and we don't want to see generic games made with the template that look the same.

    Unfortunatelly there are users that purchase the template, replace a few models (sometimes not even that) and publish as a "game", that's really sad to see. The idea is to use the template as a starting point and evolve by adding core mechanics that will make your game be more unique, like this one > https://www.kickstarter.com/projects/pigame/hercules-the-untold-stories

    We will go back to the Inventory Pro integration as soon as we finish the next update ;)

    There has being a considerable amount of users using the template with VR, but they usually use the VR controller and our AI, I'm not sure how to integrate the VR system with our camera since we don't have a VR device yet, try searching tutorials about VR on Third Person Cameras.
     
  5. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    When the player starts inside an AI radius I get the following error (I should note that the player is spawned into the scene):
    And since I have edited it so the numbers might not match, here is the line in question:
    Code (CSharp):
    1.  protected virtual void OnTriggerStay(Collider other)
    2.         {
    3.             cc.CheckTriggers(other);
    4.         }
     
  6. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    * IMPORTANT HOTFIX *

    Hey guys!

    In this last update v2.2 of the MeleeManager or Shooter v1.1 we've add open/close buttons for most of the components, and during this process the MeleeManager was missing some content to create the hitboxes, and without the hitboxes you can't hit the enemies.

    It's very simple to fix, just open the vMeleeManagerEditor and call the method DrawBodyMemberToogles(); at the line 153

    That's the MeleeManager that ship with v2.2 missing the Body Members section:


    And that's how it was supposed to be:
     
    Last edited: May 31, 2017
    Malbers likes this.
  7. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    New Tutorials Available :)





     
    julianr and Malbers like this.
  8. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    I remember there was a beat em demo in the past. Can you include the demo in your package like in the past?
     
  9. Deleted User

    Deleted User

    Guest

    So when will we get the Cover system etc.? And will you improve on the points I made?
     
  10. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Hi Teles I'm trying the new AutoEquip mode from the Item Manager

    This happen:
    upload_2017-6-2_13-21-31.png
    the weapon is instantiated on both hands

    I also tried in an empty project and had the same result.

    Although I will love to see dual weapon wielding that was not the result I was hoping for ;)
     
  11. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    We remove it because we already have too many demo scenes, and every time we need to update something big that affect all scenes is too much trouble to update them all.

    We're working on those feature and much more, but as of right now we're finishing the AI 2.0 Beta ;)
    You can follow the updates here > http://invector.proboards.com/thread/168/official-roadmap-faq


    And here is the changelog of the last update, already available on both AssetStore and vStore.

     
  12. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Hey @Malbers I just saw your post on the vForum, Jorge and I are investigating right now ;)

    Edit* @Malbers, indeed we didn't check very well for the Melee, initially we did this feature to work for the Shooter.

    We already did a great fix for the melee and now you can choose the EquipArea that this item will go, but it's a little complicated to explain here, so a quick solution for right now is to open the vItemManager script, method AutoEquipItem and add a break; after the line 655.
     
    Last edited: Jun 2, 2017
    Malbers likes this.
  13. retired

    retired

    Joined:
    Jan 13, 2015
    Posts:
    42
    Hi again drewradly. I am using ORK and cannot get the above code EquipControl.cs to work with the latest version of the melee template. The weapon animator IDs seem to get confused. Example, I equip a sword and it works fine, but when I add my shield, it does not switch to the correct block animation. If I equip the shield first, then the sword, it does not play the correct sword animation, it punches instead, while sword and shield are in hand. I am guessing something changed in the template. Any help would be much appreciated, once again thanks for all the help here thus far.
     
  14. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Hello! I never checked it with multiple mounts. Let me look into it and I'll get back to you.
     
  15. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Okay, just get rid of the EquipControl script and put this script on all the melee and shields (and guns if you want them to have melee attacks I guess):

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Invector;
    5. using Invector.ItemManager;
    6.  
    7. public class MeleeWeapon : MonoBehaviour {
    8.     public vMeleeManager _vMeleeManager;
    9.     // Use this for initialization
    10.     void Start () {
    11.         _vMeleeManager = GetComponentInParent<vMeleeManager>();
    12.         _vMeleeManager.ReInit();
    13.     }
    14.    
    15.     // Update is called once per frame
    16.     void Update () {
    17.      
    18.     }
    19. }
    I tested it several times and it works on my end, but I've edited the code so there may be unexpected problems.
     
  16. retired

    retired

    Joined:
    Jan 13, 2015
    Posts:
    42
    Thanks for the quick response. Working great, no issues after adding this updated code. I'm finally on 2.2 melee, much more optimized than the older build, thanks drewradly.
     
  17. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Helps my own project so I appreciate the feedback. Looking at it now, it so obvious why it happens.
     
  18. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    Hey Guys ... working on the Integration I have some Request for future Updates:

    on the vInput Scripts
    -A public Unity Event Transform to know when the character is Lock On target On Target Lock(Transform)
    -A public property (set; get; ) if I'm currently Locking on something (Right Now is private: isLockingOn).
    -Although I love the new UnequipCurrentEquipedItem(int , bool) I don't really know what is indexOfArea for ..and that is because I a Little lost with (vEquipArea, vEquipSlot, vItemSlot) could you give me a Little explanation for this classes?

    - On the No Inventory Example Scenes, the way I found to check if a weapon is equipped is sending a Message Upwards on the CollectableStandAlone OnEquip() Event because the VCollectMeleeControl and VCollectShooterMeleeControl doen't have any Event to let me know when a weapon is equipped / unequipped.

    -For the ShooterManager it will be nice to know how many bullets have the current ammo;
    I can check the Ammo in the chamber on the current equipped weapon using "vShooterWeapon.ammoCount"
    but the TotalAmmo from the current ammo is private. some public Property will be nice
    For now Im Using your delegate
    v_ShooterManager.totalAmmoHandler(ShooterWeapon.ammoID, ref totalAmmo); and works amazing with the inventory system on the standalone it doesn't work


    Never Mind Found public vAmmo WeaponAmmo();)

    - When you Store/Sheathe a weapon there's a delay time for showing the weapon in the holder.. which all that is managed in the vWeaponHolderManager Right?, but the thing is that when you store a weapon on foot the animations has different time that when I'm riding the horse, mine are slower .. so when I Store/Sheathe a weapon... the weapon on the holder shows before the animation has reached a desired position for store the weapon...
    So after a long and boring explanation my request is that when I Equip a weapon I will love also to control the time when the Holder Weapon is hidden and the Equipped weapon is shown and vice versa for the Unequipped action.. like overload those methods

    this Integrations is pretty complete this time!!!

    Hoping to see the Bow Combat soon :)
     
    Last edited: Jun 4, 2017
    wood333 and julianr like this.
  19. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    When the player is in the "Aiming Down" animation state, the reload animation doesn't play until AFTER you leave that state. The sound still plays the the gun still reloads but not the animation.
     
  20. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    If anyone wants a quick and easy "backstab" here is what I did. It's about as simple as it gets so don't expect much more than multiplying the damage. You'll need to edit vHitBox.cs to add a new int:
    Code (CSharp):
    1.     int curDamPer;
    2.  
    And in start add:
    Code (CSharp):
    1. curDamPer = damagePercentage;
    Then replace " OnTriggerEnter" with the following:
    Code (CSharp):
    1.     void OnTriggerEnter(Collider other)
    2.     {
    3.       if (TriggerCondictions(other))
    4.         {
    5.            
    6.             if (attackObject != null)
    7.             {
    8.              Vector3 dir = (other.transform.position - attackObject.transform.root.position).normalized;
    9.             float direction = Vector3.Dot (dir, other.transform.forward);
    10.  
    11.             if (direction > .8f)
    12.                 damagePercentage = curDamPer*5;
    13.             else
    14.                 damagePercentage = curDamPer;
    15.                 attackObject.OnHit(this, other);
    16.             }  
    17.         }        
    18.     }
    That's it. Now, if you are mostly behind whatever you are hitting, you do five times the damage. Adjust the .8f or the *5 to alter when and how much damage it does.
     
    Last edited: Jun 4, 2017
    Invector and Malbers like this.
  21. subaktiapps

    subaktiapps

    Joined:
    Feb 8, 2016
    Posts:
    31
    Whether flying animation is in it..?
     
  22. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Hey @Malbers we do have several events for the ItemManager, including one for equip/unequipping items that you could use. The suggestion to add events for the lockOn is indeed nice, I will make sure to add on the next update ;)



    There is a pretty cool custom add-on made by sickscore, it require a few modications on the core of the controller though > http://invector.proboards.com/thread/289/fly-system-v2

     
    Malbers likes this.
  23. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    Is it Possible? Enemy AI VS PLAYER "AI" With Companion "AI"
     
  24. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    I'm not sure what you mean by Player AI... he is either the Player or a AI.
    You can do Enemy vs Enemy, Enemy vs Companion, Enemy vs Player, etc...
     
  25. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    it means automatic battle. the player has options. User can control player character or He can do automatic battle
     
  26. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    I think he mean something like ff12 here your character act on his own until you interrupt with a command.
     
  27. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Hmmmm I see, that's more commum on turn based RPG or mobile rpg, we don't have this feature out of the box but you could adapt something using the AI + Player together.
     
  28. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    If you want to control the camera rotation using the left or right mouse button down then here is a small modification to the vThirdPersonInput.cs.

    Line 15

    Code (CSharp):
    1.         public enum CameraRotateMode { MouseButton_None, MouseButton_Left, MouseButton_Right }

    Line 35

    Code (CSharp):
    1.         [Header("Camera Settings")]
    2.         public CameraRotateMode rotateCameraXMode = CameraRotateMode.MouseButton_None;
    3.         public GenericInput rotateCameraXInput = new GenericInput("Mouse X", "RightAnalogHorizontal", "Mouse X");
    4.         public CameraRotateMode rotateCameraYMode = CameraRotateMode.MouseButton_None;
    5.         public GenericInput rotateCameraYInput = new GenericInput("Mouse Y", "RightAnalogVertical", "Mouse Y");
    6.         public GenericInput cameraZoomInput = new GenericInput("Mouse ScrollWheel", "", "");
    Line 388

    Code (CSharp):
    1.             var Y = rotateCameraYMode == CameraRotateMode.MouseButton_None ||
    2.                     (rotateCameraYMode == CameraRotateMode.MouseButton_Left && Input.GetMouseButton(0)) ||
    3.                     (rotateCameraYMode == CameraRotateMode.MouseButton_Right && Input.GetMouseButton(1))
    4.                     ?
    5.                     rotateCameraYInput.GetAxis() : 0f;
    6.  
    7.             var X = rotateCameraXMode == CameraRotateMode.MouseButton_None ||
    8.                     (rotateCameraXMode == CameraRotateMode.MouseButton_Left && Input.GetMouseButton(0)) ||
    9.                     (rotateCameraXMode == CameraRotateMode.MouseButton_Right && Input.GetMouseButton(1))
    10.                     ?
    11.                     rotateCameraXInput.GetAxis() : 0f;
     
    Malbers likes this.
  29. sakus

    sakus

    Joined:
    Oct 9, 2013
    Posts:
    47
    Hi, I bought the locomotion pack - nice stuff, seems like a solid basis to start building on with lots of functionalities working out of the box the way I want them to.

    Quick question about strafing though before I dig into the code - is it possible to play with the settings so that strafing would take the current character facing instead of always facing the same way as the camera? This seems to make strafing kind of useless in top down mode for example if you have a fixed rotation on the camera since your character would always face the same direction while strafing.

    So for example let's say my character is facing left in free move mode and I enable strafe. I would now want my character to keep facing left and pressing down would move the character down as expected but he would keep facing left so he would actually be strafing left from his point of view.

    Thanks!

    **edit**

    Had a moment to look around, I commented out RotateWithCamera in vThirdPersonInput and changed the velocity vector for strafe movement in vThirdPersonMotor to use the camera transform instead of the character transform. This way the character doesn't rotate to match the camera facing and it moves correctly relative to the camera view.

    But, I still have an issue with animations .. I need to figure out how to translate the speed and direction variables that are given to the animator as InputHorizontal and InputVertical in LocomotionAnimation in vThirdPersonAnimator to get correct animations out. Any tips? I suck at this stuff :)
     
    Last edited: Jun 12, 2017
  30. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Pivot / Turn and Strafing Control

    How would i setup the basic locomotion product to make the character pivot/turn on the spot when pressing left and right keys? So basically i could choose between strafing left/left and pivot turn left/right. Also does anyone know how to setup a strafe that makes the character run in a circle?
     
  31. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    There is not much mystery about using the variables into a state, just select them as the Parameter...
    Take a look into the this article to help you better understand mecanim:
    https://community.mixamo.com/hc/en-us/articles/204581427-Unity-Mecanim-Advanced-Animation

    Do you want to create a Tank controller like oldschool Resident Evil series? Not very popular this days, but I still enjoy.
    This will required a few modifications, perhaps add a new Locomotion Type to make the character turn on spot, it's not difficult though and you can find several tutorials for tank controls on youtube.
     
  32. sakus

    sakus

    Joined:
    Oct 9, 2013
    Posts:
    47
    No the issue is that now that my character is, for example, facing right and in strafe mode. I press up, and the character moves up while still facing right (so from the character's point of view he's actually moving left) BUT from the animator's point of view, pressing up means going forward when it in this case needs to mean going left so that I'd get the correct animation. I need to figure out how to translate the inputs before feeding them to the animator.

    But never mind, I realise this goes beyond supporting your asset, just figured maybe you have a nice little tip on how to pull it off. I managed to get it almost working already (gif below), but it's not perfect.. I'll keep playing around with it.


    https://media.giphy.com/media/3ohzdSNgO8HV9z6qVG/giphy.gif
     
  33. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Ohh right, you're making a topdown shooter... yeah we still don't have this feature out of the box because it's a hole other deal for camera/direction, the ideal is the character to move only with strafe and rotate with the mouse. We want to add this feature in the future, but there is other priorities right now.

    ps* it's looking pretty promissor!
     
  34. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    I'll release videos showing the changes on some updates that have new significant things to show, so you guys can enjoy more the updates, a lot of times people don't read the changelog text and miss important features.

    Here is one for the v2.2b or Shooter 1.1b



     
    julianr and drewradley like this.
  35. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966


    Hi guys

    We're making a video showcase with footage of your projects to show people what the template is capable of doing because believe me if you can, we still receive emails asking questions like "can I replace the robot model?" or "it's possible to replace animations?"

    So to help people understand how customizable the template is, we need your help!
    You can upload video footage of your project on youtube or send directly to us at inv3ctor@gmail.com

    A few notes, please try to record the footage at good framerate and resolution, we recommend Nvidia Experience if you own a Nvidia Graphics card or FRAPS if you don't.

    Thanks and hope to see more awesome projects!

    Here is a list with some of the users that share their working in progress games:

     
  36. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Hi! On the vShooterMelee DemoScene... when you pickup and auto equip the Shield and Axe, then pick up the Assault Rifle, switch to the assault rifle, which removes the Axe and also the Shield (as the assault rifle is a two handed weapon!), try and cycle through the weapons with right arrow key to find the axe again, but on the left hand side the Shield is nowhere to be seen, after cycling through the slots! Bug?
     
    Last edited: Jun 20, 2017
    antoripa likes this.
  37. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    It's actually not a bug, since you change the equipSlot of the RightArm to another weapon, it's normal for the axe to hide but the equipArea of the LeftArm is still the same, so we need to unequip the shield in order to use a two hand weapon.
     
  38. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Where does it go? After unequipping a two handed rifle, and putting the axe back, you can no longer find the shield. I also noticed that the axe and shield do not go into the Weapons holder but the shooter weapons do.. couldn't get them to go on the players back for some reason.
     
  39. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Once you change to a Two hand weapon, the LeftArm Unequip the current item and goes back to the inventory.
    We probably didn't setup holders for the axe/shield on that scene, that's why you don't see it.
     
    julianr likes this.
  40. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Ahh ok. Thanks for clearing that up. How would you stop it from going back into the inventory after equipping a two handed weapon and placed on a weapon holder. Just create a weapon holder for the shield?
     
  41. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    @Invector
    Is some ranged AI coming able to fire at player and use covers ? Actually it's very player centric and the only used AI is melee following the player.
    I don't expect the plugin to turn in some very advanced AI like CryEngine or Killzone Geurilla games bots , but i seen some people soding a great job proposing a really good AI :
     
    Last edited: Jun 25, 2017
  42. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    You can't... to use a weapon holder you need to change the current EquipSlot, and if you change it to another that already has a weapon equipped it will also unequip, get it? Currently there is no way to equip a two hand weapon at the rightarm and still leave the leftarm enabled.

    We're working on the ShooterAI ;)
     
    zenGarden likes this.
  43. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    No, that's not what I'm asking :) but I fixed it anyway. Basically once two handed rifle is equipped, the axe and shield are placed on the back of the player, then when I re-equip axe, I can re-equip shield. Before the shield was just being removed from that demo scene, where as the axe could be equipped by rotating through the key presses, but not the shield. This way I have access to the weapon and shield that I placed on my back instead of having to go back into the inventory to re-equip the shield.
     
  44. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Nice.
     
  45. Frax228

    Frax228

    Joined:
    Jul 19, 2016
    Posts:
    48
  46. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Back then I post that we're going to work on a topdown controller after a stable release of the Shooter, we're pretty stable right now but we're also working with priorities, and although I also like topdown games, it's not a priority right now because people are asking a lot about features like swimming, cover, more mobile support, new AI, etc...

    Bu I will try to implement something new like click to attack for the Diablo example on the next update, let's see how it goes ;)
     
  47. Pixelith

    Pixelith

    Joined:
    Jun 24, 2014
    Posts:
    577
    I'm a little confused on what each package includes. If I was to buy the shooter package, does it also come with the Melee package or are they completely separate?
     
  48. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
  49. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    The Shooter includes all features from both Basic & Melee Template ;)

     
    Pixelith likes this.
  50. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I recall there needing something that I had to do to use NPC over 2 units tall. Is that still the case and can you remind me what it is so I don't need to dig through all the posts? Thanks!