Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Controller Third Person Templates by Invector

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

  1. Ovaborn

    Ovaborn

    Joined:
    Jan 17, 2015
    Posts:
    3
    Yes I think I can. but I believe Invector's scripts will be much more professional and integrated (ofcourse). In fact I don't want use Invector's UI for melee weapons but use my own ugly coding for ranged ones.
    For the inventory, your solution is really interesting but nice :D

    Wow. This is good I can't wait (but I will) :D I think I'm going to wait for your solutions for ranged weapons and inventory system integration solutions. :p while waiting I can spent time with modeling or other gameplay mechanics.

    btw I was thinking about dual wielding items. (For left-hand weapons but shield. Maybe a pistol or sword, maybe a torch) I was about to buy Opsive's TPS kit just for this. Even their system's dual wielding mechanics are so buggy. I was thinking I can fix.
    So I'm happy to hear you talking about Left/Right Arm Avatar Masks (I'm not good at avatar mask animating). I think you will give us a more stable system.

    Finally what are you thinking about that ranged system in 1.3? will you sell as a separated temple like melee or will you make one template including melee and ranged?
     
    Last edited: Apr 12, 2016
  2. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    @Ovaborn most of the guys who follow this thread already knows since the very start that the Shooter will be sold separately but no worries, we will have a option to upgrade from the Melee Combat to the Shooter just as we have this option from the Basic Locomotion to the Melee Combat, and I can assure you that it will not be expensive and it will totally worth the wait ;)

    One other thing that new customers need to know is that we take our time to develop, we care a lot not only with smooth and awesome results but how you can easily set up stuff, process is very important for us and to achieve stuff like this it takes time. I know that you guys can wait to put your hands into new updates, but we will release only when we think it's awesome enough. Now that we are working full time on the template, updates will be more constant, along with new features, so stay tuned :p
     
    Ovaborn likes this.
  3. ScaraBe

    ScaraBe

    Joined:
    Oct 7, 2015
    Posts:
    43
    Correct, the only differences are
    - hip placement (parallel with bow, perpendicular with gun, strafing movement are different)
    - projectile is instantiated for the bow, not for the gun (too fast), it implies that arrow must have their own script for collision/damage.

    Can't wait to see avatar/mask too, come on, releaaaaaaaaase :D
     
  4. Ovaborn

    Ovaborn

    Joined:
    Jan 17, 2015
    Posts:
    3
    "upgrade from the Melee Combat to the Shooter" Cool :D so I can buy melee Combat template now
    And of course we know that develop takes your time :) but you need to understand is that we are excited for updates :p

    I just read your help documents. And like your controller even more. Surely a developer with time and experience can create a basic third person controller and basic AI. But yours has many feature ready in it. And I think all of them has own setup interface. Even your hand made animations quite useable in projects. I was writing an AI for stealth game style and your "Invector AI" is looking like better starter template. Not sure about details yet but I think it need just a little edit for my project.

    btw, in demos player and AI cant attack while crouching. Is it a web demo thing or you see it unnecessary?
     
  5. aziz90

    aziz90

    Joined:
    Oct 20, 2015
    Posts:
    15
    Hopefully i wasn't very picky on my first post here! But ireally can't find a solution to why the characters wont get back to the lock on stances after sprinting expect if you lock out then lock in again
     
  6. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    We though that was unnecessary, but you can easily add crouch attack, just need to add a crouch attack animation into the blend tree of the attack and add the condition crouch && attack to trigger the right animation.

    The controller will enter the strafe mode when you lock-on into a enemy, if this enemy dies you will get back to the free mode. There is a condition to exit the strafe mode when the sprint button is press, you can remove this condition on the ThirdPersonController script and put strafe sprint animations if you want to run while strafe, it's all customizable :)
     
    KaletheQuick likes this.
  7. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    How is the progress on rewired or InControl testing coming, I'm in need of gamepad support beyond the 360 controller?

    If a beta tester is needed, I'd be willing, thanks guys.
     
  8. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    It wasn't you that had integrated InControl on a previous version? o_O - v1.2b integrates the same way as before, just open the ThirdPersonController script and replace Input.GetButton for your desire input asset.
     
    kurotatsu and KaletheQuick like this.
  9. seanrod

    seanrod

    Joined:
    Jan 13, 2015
    Posts:
    52
    We bought the Template and we are so glad we did, this is a great product. We want to edit some of the animations speeds, but when we change the speed of the run the feet and arms act weird. He also floats a little.

    How can we change the speed of some animations?
     
  10. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Hi there @seanrod - thanks for your purchase! :D

    You can add extra movement speed at the Player's Inspector, there is 2 float fields that will apply extra velocity for the character's transform, or if you want to modify the animations you will need to import the fbx files into a 3D editor and change the curve of the animation it self. (Usually people prefer the first option lol)

    ps* AI does not have the 1 option yet, so you need to modify the animations.
     
  11. seanrod

    seanrod

    Joined:
    Jan 13, 2015
    Posts:
    52
    Thank you for the reply above. We will try it out right away.

    We have a different issue than the one above.

    We tried to replace some animations as described in the video tutorial, but this ended up breaking the character.
    1. Our animation has root motion (He does not move in place, he moves forward)
    2. We made sure the new animation was set to Humanoid.
    3. In the Inspector, we pressed "Copy from Avatar", select "Source" and pick our new avatar. Then, pressed the "Update" button.
    4. We dragged our run into the Base Layer> Grounded > Free Movement. We replaced the Running in the "OneHandedSword" state and the "Unarmed" state.
    5. In Root transform Rotation, we made sure the "Bake Into Pose" is checked and Base upon Original is set. We also made sure the "Root transform Position (Y)" is checked and and Base upon Original is set.

    When we do these steps, the character's legs collapses to the ground when you barely press forward on the controller.

    If you do not do the "Copy from Avatar" and "Update" the character does not collapse to the ground (which is better) however his left leg looks like he has a broken foot limp when you barely press forward on the controller.
     
  12. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    If you character make that pose when he kind of look sit down with slighty open arms, is because you put the wrong avatar, for example, if you download this animation from mixamo, you need to make sure that you are using the original model of the animation, you can also upload your current model into mixamo's website, select the animation and download just the skin without the mesh (small files) and put the avatar of your model.
     
  13. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Guess what we're working on guys :D

     
    JamesArndt and ScaraBe like this.
  14. jmacgill

    jmacgill

    Joined:
    Jun 17, 2014
    Posts:
    17
    Red vs Green.... could it be networked multiplayer???
     
  15. KaletheQuick

    KaletheQuick

    Joined:
    Feb 12, 2016
    Posts:
    41
    Team based AI, different AI groups, or Squad Based AI.
     
    ScaraBe and abatcat like this.
  16. ScaraBe

    ScaraBe

    Joined:
    Oct 7, 2015
    Posts:
    43
    Holy sh** !
    I'm going to bed with smile :) & news ideas for my game.
    Thank you :p
     
    Invector likes this.
  17. wetfiregames

    wetfiregames

    Joined:
    Nov 17, 2012
    Posts:
    28
    Companion AI would be my guess
     
    Invector likes this.
  18. snackzilla

    snackzilla

    Joined:
    Aug 17, 2014
    Posts:
    91
    Hello Invector! I've got a quick scripting question I'm hoping you can help me out on. I'm trying to directly manipulate the values of startHealth and currentHealth. I see it set twice in both Character.cs, and Character Properties.cs. Which one would I need to change in order for it to work properly? What I'm trying to do is link the plyGame health with the Invector health. Ex. Player gains enough experience to level up, startHealth (and by extension, currentHealth) is raised. So far, I've had trouble writing my desired value to either script. Any tips on manual manipulation of health? Either inside the editor with blox, or better yet, in the code. I can pull the plyGame Health attribute as a float value just fine, but applying it to the character directly is another story.
     
  19. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    @snackzilla The script Character Properties was just a prototype, it was never supposed to be on the final version, I guess we forgot to remove the script from the project, sorry about that lol. You can access the health by Invector.CharacterController.ThirdPersonController.instance.startHealth, or with GetComponent works too, same for the currentHealth and stamina.
     
    snackzilla likes this.
  20. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Guys, it's AI vs AI and NPC Companion with Comands like Stop, Follow, Passive behaviour, Agressive behaviour :p
     
    KaletheQuick, snackzilla and hopeful like this.
  21. snackzilla

    snackzilla

    Joined:
    Aug 17, 2014
    Posts:
    91
    I was wondering! Since many of the same values were declared twice. :) I actually JUST got the Health and Stamina working perfectly with plyGame. I went a WAY round'about way by using the Health/Stamina UI slider as an intermediary for the plyGame blox system to write values to, thereby changing the values on the player itself. (I had to modify a couple lines of code as well) I'll try to go back and edit them directly on the player controller once I tackle the inventory! Again, thanks for the well commented code. AI Followers would be friggin' amazing. Keep up the great work!
     
    Invector likes this.
  22. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Yeah it was me, and I did, just took a loooong leave from unity and probing to see where things are at.

    Thx for the reply.
     
  23. KaletheQuick

    KaletheQuick

    Joined:
    Feb 12, 2016
    Posts:
    41
    Damnit. Now I need to wait for you to finish that before I make MY AI. Lol.

    I am making a game loosely based on Ghost Recon Advanced Warfighter 2 in gameplay at least. Third person shooter, AI squadmates, short deadly shootouts. And commanding and communicating with your AI dudes is super important. That, obviously, would need to be built on top of all your stuff. Which is good, because you can clearly code better than me. :p

    On a different note, me gushing about an under appreciated game, In GRAW2 your AI squadmates would actually call out and tell you with words where the enemy was. Like, in one of the starting missions my mind was BLOWN when my comrade said "There are two enemies next to that green truck!" Seriously great stuff.
     
  24. ScaraBe

    ScaraBe

    Joined:
    Oct 7, 2015
    Posts:
    43
    I have a little question, hard to explain here because I'm at office now & have no acces to scripts/unity...
    As I said in a previous post, when aiming with a bow, shooting direction is aligned with two shoulders, it implies that torso is facing a perpendicular direction.
    So, I have to disable head tracking when shooting with a bow, otherwise, arrows goes to perpendicular direction lol.
    The problem is When head tracking is disabled I can shoot in the good direction, but not up/down (because spine curvature is also disabled).

    I don't know how to fix this. :( (Can I keep headTracking On and tell script which face of torso object is looking at taget?)

    No problem with a gun, because torso is always facing the taget :cool:.

    Have a nice day ! :D:D:D
     
  25. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Hmm if your aiming with bow action is turning the headTracking bool false, then you need to remove the bow action of the headTracking conditions to not turn false. Open your ThirdPersonAnimator script and at the bottom, search for the method OnAnimatorIK and the local variable headTrackConditions.

    ps* I just update the HeadTrack method, now there is separate float options for the head, body when on free movement or strafe movement, velocity to blend, and max angle ;)

    I confess that I have never play Graw2 but I know the series, and they always did a great job with AI, it's a very good source of inspiration.

    Glad you're back ;)
     
    Last edited: Apr 14, 2016
    KaletheQuick likes this.
  26. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    When you think about npc on npc, etc. would you consider factions? By factions I mean teams that can be allies or enemies with each other, and teams that can change allegiance in run time. Like in a RPG. Each team carries a list of its enemy (teams) factions, and enemies can be added or removed during play.
     
  27. abatcat

    abatcat

    Joined:
    Feb 8, 2015
    Posts:
    70
    I think there is an asset that does that on the assetstore called love/hate (have never used it myself)
    https://www.assetstore.unity3d.com/en/#!/content/33063
     
  28. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Hmmm this is more specific behaviour, we will only code more generic stuff so that you guys can have a nice base to start and create your own stuff. But TeamA vs TeamB is very possible, also instantiate and remove during play. ;)
     
    KaletheQuick likes this.
  29. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    WOW AI VS AI COMBAT?? That's great!!!!
     
  30. ScaraBe

    ScaraBe

    Joined:
    Oct 7, 2015
    Posts:
    43
    Niiiiiiiiiice :D, those animations drive me crazy lol, now, instead of disabling head tracking, I set spinecurvature to zero, when aiming /bow, upper body & head are in right direction (looking target), but if target is upper or under player, they don't follow in up/down direction. If I set spinecurv. >0, they follow target up & down, but upper body turns 90°... I'm gonna eat my keyboard :rolleyes:

    I hope those tune settings will help me, it would be cool if you could set horizontal & vertical spinecurv. ;)
     
  31. ScaraBe

    ScaraBe

    Joined:
    Oct 7, 2015
    Posts:
    43
    Found a temporary ugly solution to fix it, but not proud of it because I wanted to use spinecurvature :confused: :
    when aiming w/ bow, spinecurvature set to zero = 0 for left/right follow, and a little Player.transform.LookAt(TPCamera.instance.lockTarget) for up/down...
    If camera is close to player enough the illusion works

    Think I need to sleep now o_O
     
  32. seanrod

    seanrod

    Joined:
    Jan 13, 2015
    Posts:
    52
    We tried the Mixamo animations. We have their mesh attached to the model(in the FBX).
    We tried to replace some animations as described in the video tutorial, but this ended up breaking the character.
    1. Our animation has root motion (He does not move in place, he moves forward)
    2. We made sure the new animation was set to Humanoid.
    3. In the Inspector, we pressed "Copy from Avatar" and select the Invector Avatar. Then, pressed the "Update" button.
    4. We dragged our run into the Base Layer> Grounded > Free Movement. We replaced the Running in the "OneHandedSword" state and the "Unarmed" state.
    5. In Root transform Rotation, we made sure the "Bake Into Pose" is checked and Base upon Original is set. We also made sure the "Root transform Position (Y)" is checked and and Base upon Original is set.

    The Character broke.

    If we use the "Create From This Model", the Character breaks, too.

    I think There is a step that I'm not doing correctly, may I ask for some advise on how to replace animations?
     
  33. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Hmmm... I don't know what you mean by "the character broke", can you record a video and send to inv3ctor@gmail.com?
    It would also be helpful if you record your process of replacing this animation.
     
  34. seanrod

    seanrod

    Joined:
    Jan 13, 2015
    Posts:
    52
    I'll see if we have that ability, Thank you.
     
  35. KaletheQuick

    KaletheQuick

    Joined:
    Feb 12, 2016
    Posts:
    41
    I think I'm being dumb, but how do I enable the raycast checkers so i can see them?
     
  36. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Just select your character, you also can enable the Gizmos option on the top right of the Game Window to see in-game
     
  37. sean3Dmonkey

    sean3Dmonkey

    Joined:
    Oct 21, 2014
    Posts:
    69
    We could not do a video, but here are some screen grabs of the process we are doing to set up the FBX so we can change animations.
     

    Attached Files:

  38. supneo

    supneo

    Joined:
    Jul 29, 2012
    Posts:
    32
    Hello @Invector , every game or almost every third person games are swimming, diving, you plan to implement ? , Thank you.
     
  39. KaletheQuick

    KaletheQuick

    Joined:
    Feb 12, 2016
    Posts:
    41
    Earlier in the thread they said that is not on their agenda. But they tell you how you can do that. I think another person also did it and posted a video. Read the thread.
     
  40. KaletheQuick

    KaletheQuick

    Joined:
    Feb 12, 2016
    Posts:
    41
    Figured it out. "Transform" was unchecked from the gizmos list.
     
  41. sticklezz

    sticklezz

    Joined:
    Oct 27, 2015
    Posts:
    33
    I thought I saw this before but I can't find it- is there a way to start level with a weapon on the player?

    EDIT: Looks like you just add it to the handler, and click "start using" on the weapon- cool!
     
  42. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Step 2 is the issue @sean3Dmonkey, your animation model is using the Character "Beta" from Mixamo's, but you're trying to add the V-Bot avatar, you need to download the Beta fbx model in T-Pose, make it Humanoid and apply his avatar into his animation. Just like this video tutorial shows at around 0:35



    It's not a priority right now, but We still want to add this feature in the future :)
     
    KaletheQuick likes this.
  43. snackzilla

    snackzilla

    Joined:
    Aug 17, 2014
    Posts:
    91
    Hello again, Invector! I've got another question (I'm sorry.) It's about the shield. What I'm trying to accomplish is that when a weapon (either on the player or on the AI) hits a shield that is in the block mode, it triggers a custom recoil animation. As it is right now, the attack still completes, and just subtracts the damage from the total it would have been without the block. I'm wanting the attack animation to be interrupted when it hits the shield and instantly transition to my custom recoil animation. Now that I've integrated plyGame, I could do it in blox, but I was wondering if you guys had another method to automatically detect collision between sword and shield?

    EDIT: Nevermind..There's literally an option on the shield for "Break Attack". You guys thought of everything.

    I do still have an issue where the AI will literally move through the character while attacking though. I'm guessing that's because the animations are using root motion? Any way to fix this while still keeping the root motion?
     
    Last edited: Apr 15, 2016
  44. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    o_O can you record a video? the enemy will only pass through the player if he dies, because we make the capsule collider trigger to avoid stuck the player on small corridors for example
     
  45. snackzilla

    snackzilla

    Joined:
    Aug 17, 2014
    Posts:
    91
    I will take a video later tonight as I'm on my work laptop without screen capture software. That's interesting, though.So the capsule collider being a trigger actively stops the AI from moving through the player? Whenever I check "Is Trigger" on the capsule collider and hit play, my character falls through the floor. o_O Or is it controlled somewhere in the script and not in the editor?
     
  46. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    It's done by script, but anyways v1.3 has new collision verifications I want to finish this update as soon as possible so that you guys can have the latest methods, it's working way better.
     
    snackzilla likes this.
  47. abatcat

    abatcat

    Joined:
    Feb 8, 2015
    Posts:
    70
    Will you be implementing any kind of stealth mechanics in the future?
    A stealth addon maybe :D
     
    kurotatsu likes this.
  48. ScaraBe

    ScaraBe

    Joined:
    Oct 7, 2015
    Posts:
    43
    Arf o_O I've just realised that you have changed the TakeDamage function in ThirdPersonMotor :rolleyes:

    Can you add an healing function? For now I was using TakeDamage() with a negative Damage parameter.

    Can't wait 1.3 :D
     
  49. ScaraBe

    ScaraBe

    Joined:
    Oct 7, 2015
    Posts:
    43
    Edit: Ok, forgot it, as you say before, its way faster to use ThirdPersonController.instance.currentHealth += Health;
     
  50. Chaz32621

    Chaz32621

    Joined:
    Apr 17, 2015
    Posts:
    199

    Haha Invector wait till you see my master piece of my modifications of the game engine lol
     
    jcarrick and Invector like this.