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. snackzilla

    snackzilla

    Joined:
    Aug 17, 2014
    Posts:
    91
    Thank you. :) I will work on other stuff in the meantime. Looking forward to the release! You guys are awesome.
     
    Invector likes this.
  2. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Yep just like the Basic has a upgrade option to the Melee, both will have option of upgrade to the Shooter ;)

    And with the vStore you can get updates faster because we don't have the 3~6 days wai to approve the package, we just send a download link to our customers list :)
     
    eses likes this.
  3. Rose-Remnant

    Rose-Remnant

    Joined:
    Nov 14, 2012
    Posts:
    123
  4. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    1.4 version How does affect on performance?
     
  5. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Open the ThirdPersonMotor script and find the Debug method, we control the Time.scale there, just comment the lines and it should work on your new menu :)

    Performance is the last thing that we test, but it's looking promissor since we remove a couple of raycasts and expensive calls on the controller
     
  6. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    63
    Congratulations for your excellent work! How can I add points in my score game when the enemies dead? Thanks!!
     
  7. Rose-Remnant

    Rose-Remnant

    Joined:
    Nov 14, 2012
    Posts:
    123
    @Invector I changed files in many locations but it works :), thanks very much
     
    Invector likes this.
  8. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    35% OFF today guys :p - and you can UPGRADE to the Melee Combat for just $10

     
    Malbers likes this.
  9. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Well there is many ways to do that, but one way is to add a count or send a message to a method that add score right before the AI dies, look for the Motor or Animator, there is 2 methods that verify if the AI is dead.
     
  10. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    300
    Are there any plans for integration with A* Pathfinding Project Pro by Aron Granberg?
     
    Cartoon-Mania likes this.
  11. justdance123

    justdance123

    Joined:
    Mar 14, 2016
    Posts:
    9
    Invector, How do i set to mobile controller? Thanks for the answer
     
  12. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Maybe when we remake the AI we can take a look ;)

    There is a prefab call Mobile Controls, just drag and drop this prefab into your UI and change the Project to android or iOS. Take a look at the mobile demo scene to see how it works.
     
  13. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    63
    I've found the Method CheckHealth in v_AIMotor and I've add a reference to my Score Script to add 10 points when enemy dies but doesn´t sum the points. Any solution please?

    #regionAI Health

    public void CheckHealth()
    {
    //Iftheplayerhaslostallit'shealthandthedeathflaghasn'tbeensetyet...
    if (currentHealth <= 0 && !isDead)
    {
    //if(vSpawnEnemies.instance!=null)vSpawnEnemies.instance.CheckEnemyAlive(this);

    isDead = true;
    Debug.Log("DeadEnemy");

    Player.GetComponent<PuntosPistas>().Score = Player.GetComponent<PuntosPistas>().Score + 10;

    PlayerPrefs.SetInt("Score",Player.GetComponent<PuntosPistas>().Score);
    PlayerPrefs.Save();
    Debug.Log("Add10points");

    DisableActions();
    }
    }
     
  14. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    1.gif

    Hi everyone,

    i would like to share my little package to add the first person view to the inVector Basic Locomotion Template v1.3 .

    It is very basic and don't need any modification of the official code.

    The only modification needed is to add "HeadTrack" tag to each animation state in which you want control the FPCamera (Strafing Crouch...StepUP..etc).

    Hoping in a more robust official version ...this could give some fun.

    Cheers

    Max
     

    Attached Files:

    Last edited: Aug 19, 2016
  15. jayimagination

    jayimagination

    Joined:
    Dec 20, 2012
    Posts:
    89
    thanks for this, hopefully it will work with the shooter template as well :)
     
    sjm-tech likes this.
  16. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    You can create a method to add score on your PuntosPistas script, and just call the method inside this if of the CheckHealth
     
  17. indra-p

    indra-p

    Joined:
    Mar 12, 2013
    Posts:
    38
    hello..
    can i create a pedestrian path with this template? just like in gta.. i tried using the waypoint, i know how to make the ai walk in a waypoint, but before he walk in a loop, the AI always wallk to the first number(waypoint 01) wherever i put him ... i want him to start walking from the nearest point from where he placed.. i hope you know what i mean..it is posible to do?

    btw this is my game.. thanks for the awesome template...
     
    Last edited: Aug 17, 2016
    Invector and jayimagination like this.
  18. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    I like this bunnies so much and I laughed more than I should lol - We have a option to random waypoints but not a "start with closest", it shouldn't be hard to add though - I will take a look later and post here.

    edit* you just need to vefiry the closest wp around, something like this:

    *non-tested

    Code (CSharp):
    1.   var dist = Mathf.Infinity;
    2.             int startWayPointIndex =0;
    3.             for(int i=0; i<WayPoints.Count.i++)
    4.             {
    5.                 var currentDist = Vector3.Distance(waypoints[i].position, transform.position);
    6.                 if (currentDist < dist)
    7.                 {
    8.                     dist = currentDist;
    9.                     startWayPointIndex = i;
    10.                 }
    11.             }
     
    Last edited: Aug 17, 2016
    indra-p likes this.
  19. Sluta

    Sluta

    Joined:
    Aug 15, 2016
    Posts:
    42
    Hello

    v 1.3 Third Person Controller - brought big changes.

    And now tutorial videos such as:




    are outdated :(

    Is there a chance for the correct version tutorials?
     
  20. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    Hey there, yeah indeed the first video is outdated for the Basic v1.3 now, but the second one is basically the same process.
    I will create a new video tutorial on how to add new animation as soon as the Melee v1.4 be released, they have the same new big changes in the animator component ;)
     
  21. Sluta

    Sluta

    Joined:
    Aug 15, 2016
    Posts:
    42
    Of course, adding animations is more important.

    I bought Third Person Controller and this is a great asset.
    Especially for someone who wants to create a game - clone, like Resident Evil or Dark Souls.

    But the use of the package to a slightly different kind of games, sometimes requires many modifications.
    It would be great if the asset was even more friendly changes.

    But i understand that I demand too much
     
  22. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    89
    What are you trying to do? In my experience turning this into a game like dragons dogma, witcher 3, diablo 2, etc is really down to a few options and tweaks. The only coding i have done for this was to make a heavy attack, which they came out with as an update a week later.
     
  23. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    @Shadex we answer you on the vForum a while ago, didn't know if you ever saw the answer lol

    http://invector.proboards.com/thread/14/canceling-hit-reaction-animations
     
  24. PeuBraw

    PeuBraw

    Joined:
    Jul 22, 2014
    Posts:
    2
    Guys, any1 know the best ai asset that integrates well with invector ?

    I really need a better ai for my project and ICE one didnt do the job well or I failed to integrate it, I had a problem with the ai-player colliders...
     
  25. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    89
    Yea, had to rebuild my computer, so i've been out for a bit. I also do not think i explained the problem right. I am going to have to make a video showing what i mean. That might be a short bit. I thank you for the reply though.
     
  26. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    63
    Thanks! I've done but in the console appears this error:

    NullReferenceException: Object reference not set to an instance of an object
    Invector.v_AIMotor.CheckHealth () (at Assets/Invector-3rdPersonController/Scripts/CharacterAI/v_AIMotor.cs:504)
    Invector.v_AIMotor.TakeDamage (.Damage damage) (at Assets/Invector-3rdPersonController/Scripts/CharacterAI/v_AIMotor.cs:582)
    UnityEngine.Component:SendMessage(String, Object, SendMessageOptions)
    vMeleeManager:OnDamageHit(HitInfo) (at Assets/Invector-3rdPersonController/Scripts/MeleeCombat/vMeleeManager.cs:295)
    UnityEngine.Component:SendMessageUpwards(String, Object, SendMessageOptions)
    Invector.vHitBox:CheckHitProperties(Collider) (at Assets/Invector-3rdPersonController/Scripts/MeleeCombat/vHitBox.cs:68)
    Invector.vHitBox:OnTriggerEnter(Collider) (at Assets/Invector-3rdPersonController/Scripts/MeleeCombat/vHitBox.cs:48)


    ***I've created this method in my PuntosPistas script:

    public class PuntosPistas : MonoBehaviour {
    public int Score;
    public Text TextoContador;

    void Start ()
    {
    Score = PlayerPrefs.GetInt("Score");
    TextoContador.text = "" + Score;
    }

    public void KillEnemy()
    {
    Score = Score + 10;
    TextoContador.text = "" + Score;
    PlayerPrefs.SetInt("Score",Score);
    }

    *** And I've added this lines in v_AIMotor to call this method:

    public class v_AIMotor : vCharacter {
    GameObject Player;

    void Start ()
    {
    Player = GameObject.FindGameObjectWithTag("Player");
    }

    public void CheckHealth()
    {
    if (currentHealth <= 0 && !isDead)
    {
    isDead = true;
    Player.GetComponent<PuntosPistas> ().KillEnemy ();
    DisableActions();
    }
    }
     
  27. CardiacArrest

    CardiacArrest

    Joined:
    Jan 15, 2016
    Posts:
    1
    @Invector
    Hello!
    I've been trying to change the weapons via script and I've been having some issues. I'm trying to achieve something like dark souls where you can change your current weapon and shield by pressing the arrow buttons. I've been looking around the functions in the vMeleeManager script and couldn't really achieve much.
     
    Last edited: Aug 21, 2016
  28. indra-p

    indra-p

    Joined:
    Mar 12, 2013
    Posts:
    38
    glad you like it... im not a coder..i have no idea where to put those codes..but nevermind.. i wish you will add the "start from closest" feature in the future update...
     
    sjm-tech likes this.
  29. jgiroux

    jgiroux

    Joined:
    Jul 21, 2015
    Posts:
    22
    Are you still trying to get this to work?

    if so try this:

    I don't know all your code, so this is generic, but will do what you want without having to edit any invector code

    create a new script and call it "CoinCollector"

    add this code
    then save/compile

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using Invector.CharacterController;
    4. using Invector;
    5.  
    6. public class CoinCollector : MonoBehaviour
    7. {
    8.     private GameObject Player;
    9.     [Header("Player Settings")]
    10.     public int CoinsCollected;
    11.     public int TotalEnemiesKilled;
    12.     [Space(10)]
    13.  
    14.     private bool doOnce;
    15.     [Header("Enemy Settings")]
    16.     public int EnemyCoinsWorth;
    17.     // Use this for initialization
    18.     void Start()
    19.     {
    20.         Player = GameObject.FindGameObjectWithTag("Player");
    21.     }
    22.  
    23.     // Update is called once per frame
    24.     void Update()
    25.     {
    26.         if (GetComponent<v_AIController>() != null)
    27.         {
    28.             if (GetComponent<v_AIController>().currentHealth <= 0 && doOnce == false)
    29.             {
    30.                 doOnce = true;
    31.                 Player.GetComponent<CoinCollector>().CoinsCollected = Player.GetComponent<CoinCollector>().CoinsCollected + EnemyCoinsWorth;
    32.                 Player.GetComponent<CoinCollector>().TotalEnemiesKilled++;                
    33.                 PlayerPrefs.SetInt("Score", Player.GetComponent<CoinCollector>().CoinsCollected);
    34.                 PlayerPrefs.Save();
    35.                 Debug.Log(Player.GetComponent<CoinCollector>().CoinsCollected.ToString() + "Points were added");
    36.  
    37.             }
    38.         }
    39.     }
    40. }
    41.  

    steps:
    Step 1) add this script to your Player Character. You don't need to adjust any values, but you will be able to see the updated coins list in the fields and I presume you could then tie this into your own script, or modify this one to work with yours.

    Step 2) Add this script to all your enemies that should drop coins. Adjust Coins Worth value to however much this enemy would be worth.

    That's it.
    I also included a Total Enemies killed for you so you can also keep track of that as well.

    remember, its the Player version of this script that will store all your values, the enemy version just updates the players version of this script.
     
    Last edited: Aug 21, 2016
  30. uni7y

    uni7y

    Joined:
    Jul 23, 2012
    Posts:
    287
  31. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    @CardiacArrest We're doing just that on the new upcoming update 1.4, along with a inventory example very similar to DS ;)


    Sure! but don't forget to import only the animations and UNCHECK the InputManager, TagManager and any other playmaker scripts.
     
  32. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    374
    Hi Invector, compliments for your work.
    I have this problem with the idle-->startWalking animation:

    The character "slide" at the beginning of walking animation.
    Where can I set the character acceleration?
     
  33. bluray467

    bluray467

    Joined:
    May 28, 2015
    Posts:
    15
    Hi!
    I have a question!
    when i use a fixed point camera the player only moves in forward, no matter what button i press, how do i fix this?
     
  34. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    It seens that your animations is 'inplace', it's better if you get one with root motion instead.
    Also, you're using a very old version of the template - try update to get better results

    Try taking a look at the V-Mansion demo scene and see if there is something different set up on the player, camera and triggers.
     
  35. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    374
    Hi, thanks for the reply. I have update but now i have this error:

    He does this only if I import the assets in my project.
    On a new project everything works properly.

    Unfortunately, in my project I can not import the ProjectSettings folder.
    I do not know if it depends on this.
     
    Last edited: Aug 23, 2016
  36. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    @WILEz1975 the ProjectSettings is very important for the funcioning of template, since it is a Complete Project and required the Input Mapping, Tags, Layers, etc... The ideal is to build a game using the template as the base, and not the contrary
     
  37. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    374
    I get it.
    If you are interested, this is the game I'm working on:





    I working on STAR SHIFT by more than a year and has become very complex so I can not change tags, inputs etc ...
    There are also "walking sessions" and I would have liked to use your assets for the third person.
    I will do other tests to integrate the asset in my project.
    Thanks to the availability.
     
    wood333, ikemen_blueD and Malbers like this.
  38. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    I just realized something. If King Priam's son (from Homer's Iliad) obtained employment in Invector's quality assurance department, he would be: Hector the Invector Inspector. :rolleyes:

    Oops, went off topic. Sorry.
     
    Last edited: Aug 24, 2016
    Malbers and Invector like this.
  39. Rose-Remnant

    Rose-Remnant

    Joined:
    Nov 14, 2012
    Posts:
    123
    @Invector where are you setting quit on pressing Escape? I need to turn that off for the menu.
     
  40. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
    VERY nice project @WILEz1975, excellent use of shaders and lens!
    You're using the Basic Locomotion or the Melee Combat?

    I'm assuming that is the Basic since your game doesn't look to have melee combat, you can import the package without the Tags & Layers (we have a script that will automatically add the ones we need) and also uncheck the InputManager, and create another empty project to import all, then you can manually add the inputs we need into your project and also customize the inputs in the vThirdPersonInput script.

    vThirdPersonController script at the bottom on the MeleeCombat v1.3e
    vThirdPersonInput script on the Basic Locomotion v1.3
     
    Last edited: Aug 24, 2016
  41. angelsm85

    angelsm85

    Joined:
    Oct 27, 2015
    Posts:
    63

    Thank you so much !! I've adjusted my game and It works :)
     
    jgiroux likes this.
  42. Rose-Remnant

    Rose-Remnant

    Joined:
    Nov 14, 2012
    Posts:
    123
    Thanks!
     
  43. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    89
    That looks seriously good. I love the old wing commander style, with modern shader's and graphics. If that plays anything like it looks you are going to really well.
     
  44. Gojira96

    Gojira96

    Joined:
    Jun 18, 2015
    Posts:
    32
    Guys I am finishing my project,

    I have also created a Website and Facebook page.

    If you can check it out it would be of great help.

    http://www.clanaspect.com/

    Here are some screenshots for you guys,the rest you can see on my website and/or Facebook. :)
    ClanAspect56.png ClanAspect144.png ClanAspect19.png ClanAspect34.png
     
    Invector, Shodan0101 and Malbers like this.
  45. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    966
  46. HellPatrol

    HellPatrol

    Joined:
    Jun 29, 2014
    Posts:
    38
    I have a problem with the camera.
    When my character walks behind or near a object / collider the camera transforms way too far towards or even into the the character.
    Is there a way to disable this?
     
  47. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Hi,
    is this amazing tool compatible with UniStorm and Inventory Pro ?
    Regards
     
  48. snackzilla

    snackzilla

    Joined:
    Aug 17, 2014
    Posts:
    91
    Inventory Pro: As of right now, Not out of the box. I've gotten it to work with some custom code, though. Essentially you just create your item as a Invector Weapon first, then add the I.Pro components to it. You also have to have a script to the weapon to disable the Invector method of picking up the weapon (As you want Inventory Pro to handle picking the item up, and adding it to the inventory) then another script to tell the Invector Player controller that when the item is equipped, to put it in the proper weapon handler and change the animation state. You can read back through this thread on more information on en/disabling weapons. User drewradley, has written a nice bit of code to do this very thing a couple pages back. With the upcoming 1.4 upgrade, Invector has said they came up with a way easier to handle weapon equipping, so hopefully it'll be easier to integrate the two systems once the update drops.

    UniStorm: It's just an weather/time of day system, right? I don't see any reason it wouldn't work with this controller. As far as I know, you can drop an Invector Player in any environment/landscape, including one with UniStorm components, and it should work just fine. (If it's a custom landscape, you'll still have to bake the navmesh for the AI, but that's like two clicks.)
     
    Invector likes this.
  49. koki05216

    koki05216

    Joined:
    Sep 1, 2016
    Posts:
    1
    Invector, Thank you Third-Person-Controller-Templates-unitypackage ! very very fantastic(enjoy 1.3c)!
    but I have problem with the enemyAI.

    When object(box)-position move at "2.5DController-Demo.unity", enemyAI is not up the object, and slips through.(for example , following image)

    Does this unitypackage is a difficult to map-editing(object-editing with enemyAIwork)?
     

    Attached Files:

  50. Sluta

    Sluta

    Joined:
    Aug 15, 2016
    Posts:
    42
    @Invector
    You can add a function (in inspector) to switch the visibility of the mouse cursor (in Third Person)?