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

TPSA - Third Person Aim System

Discussion in 'Scripting' started by Stiffx, Dec 29, 2014.

  1. IchBinJager

    IchBinJager

    Joined:
    Dec 23, 2014
    Posts:
    127
    Impressive.
     
    Stiffx likes this.
  2. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Thank you
     
  3. IchBinJager

    IchBinJager

    Joined:
    Dec 23, 2014
    Posts:
    127
    You're welcome. Maybe it isn't much, but it's more than I could probably actually do.
     
  4. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Here we go...new update (Thank you blackbird for the tip)

     
  5. kierenhovasapian

    kierenhovasapian

    Joined:
    Dec 23, 2014
    Posts:
    87
    Great work with the cover!
     
    Stiffx likes this.
  6. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Thank you
     
  7. Josguerraful

    Josguerraful

    Joined:
    May 20, 2013
    Posts:
    2
    Going to be free said it xD
     
  8. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    New and last update before release. I'll be uploading to Assetstore by tomorrow.
     
    JouTaino45 likes this.
  9. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Free was the first tough when the system only had simple aiming.
     
    Haseeb_BSAA and blackbird like this.
  10. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Here what's coming after the release

     
    Last edited: Jan 9, 2015
    Razputin, blackbird and JouTaino45 like this.
  11. JouTaino45

    JouTaino45

    Joined:
    Dec 26, 2014
    Posts:
    22
    Good work, hopefully a pickup weapon system is added.

    Once, I have the package I hope to add more weapons for the character.
     
    Stiffx likes this.
  12. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Thank you, the pickup system is ready, you can pickup from Up, Down and middle.
     
    blackbird likes this.
  13. JouTaino45

    JouTaino45

    Joined:
    Dec 26, 2014
    Posts:
    22
    Oh OK Cool, I thought it was for ammo only.
     
  14. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Here JouTaino45



    Of course you would have to add logic to pick a diferent object type
     
    blackbird and JouTaino45 like this.
  15. ElectroMantis

    ElectroMantis

    Joined:
    Sep 15, 2013
    Posts:
    78
    Another question -

    Would you ever consider releasing a "Lite" version that contains just the aim script and IK solver for a lower price? Don't get me wrong, all the features and art you've added look really good. I just don't think I'd need all of them for the game I'm working on.

    Anyways, looking forward to final release! :)
     
    Stiffx likes this.
  16. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Thank you SecondBake, but at this point I don't know, I've thought about that in the past and now the template has so many features, i don't think i'll do it by now. I've asked this question in the past, most of the interested people said no small pack plus the the aiming part is one of the most important part of the system. Maybe in the future who knows but thanks for asking
     
  17. Josguerraful

    Josguerraful

    Joined:
    May 20, 2013
    Posts:
    2
    ok xD if i have the money i will buy it, its cool
     
    Stiffx likes this.
  18. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Thank you

    Here is how you Setup a pickup Weapon at the system, totally out of the box
     
    JouTaino45 likes this.
  19. JouTaino45

    JouTaino45

    Joined:
    Dec 26, 2014
    Posts:
    22
    You did not have to do that, but awesome Stiffx you are awesome. vc e mito :);)
     
    Stiffx likes this.
  20. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    haha valeu. Thanks
     
    JouTaino45 likes this.
  21. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    did you submit it to asset store ? any idea of the release day ?
     
    Stiffx likes this.
  22. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Yes, did it yesterday now I'm waiting the approval.
     
    JouTaino45 and blackbird like this.
  23. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    great how much it takes for the approval ? by the way are open to make another type of controller something like legend of zelda controller ?
     
  24. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    The UT said 3 business days.

    The first control was like that game, so the only difference now is that the character rotates according the camera X rotation, you could easily change that at the Player Controller script
     
    blackbird likes this.
  25. JouTaino45

    JouTaino45

    Joined:
    Dec 26, 2014
    Posts:
    22
    Now we wait...:cool:
     
    Stiffx likes this.
  26. Haseeb_BSAA

    Haseeb_BSAA

    Joined:
    Aug 20, 2014
    Posts:
    316
    You must be an experienced programmer!! Great work :)
     
    Stiffx likes this.
  27. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Thank you but i have alot to learn this is the result of 4 years learning unity.
     
    Haseeb_BSAA likes this.
  28. Haseeb_BSAA

    Haseeb_BSAA

    Joined:
    Aug 20, 2014
    Posts:
    316
    Cool! And how much years did you learn programming?
     
    Stiffx likes this.
  29. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Its been 15 years i still work with software development php/c#/java (j2me) / sql
     
    Haseeb_BSAA likes this.
  30. Haseeb_BSAA

    Haseeb_BSAA

    Joined:
    Aug 20, 2014
    Posts:
    316
    Wow great!! :)
     
    Stiffx likes this.
  31. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Thank you :)
     
    Haseeb_BSAA likes this.
  32. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    I created a Sponsors script just in case you guys need it. It will fade in and out a image sequence and then load a level.



    Code (csharp):
    1.  
    2. using System.Collections;
    3. using UnityEngine;
    4.  
    5. public class TPSA_SponsorImages : MonoBehaviour
    6. {
    7.   public Texture2D[] Sponsors; // The Texture you want to manipulate. Set this up in the inspector.
    8.   public float StayTime = 2f;  // Time before fadeout starts
    9.   public string LevelAfterSponsors = "Menu";
    10.  
    11.   private float imageAlpha = 0f;
    12.   private bool reachEnd = false;
    13.   private int currentSponsor = 0;
    14.  
    15.   private bool shouldFadeIn = true;
    16.   private bool shouldFadeOut = false;
    17.   private bool requestedLevel = false;
    18.  
    19.   void Update()
    20.   {
    21.   if (Sponsors.Length == 0 || reachEnd == true)
    22.   {
    23.   if (!requestedLevel)
    24.   {
    25.   requestedLevel = true;
    26.   reachEnd = true;
    27.   Application.LoadLevel(LevelAfterSponsors);
    28.   return;
    29.   }
    30.   }
    31.   }
    32.  
    33.   IEnumerator WaitTime()
    34.   {
    35.   yield return new WaitForSeconds(StayTime);
    36.   shouldFadeOut = true;
    37.   }
    38.  
    39.   void fadeIn()
    40.   {
    41.   if (!shouldFadeIn)
    42.   return;
    43.  
    44.   imageAlpha = Mathf.Lerp(imageAlpha, 1f, Time.deltaTime * 0.65f);
    45.  
    46.   if (imageAlpha > 0.99)
    47.   {
    48.   shouldFadeIn = false;
    49.   StartCoroutine(WaitTime());
    50.   }
    51.   }
    52.  
    53.   void fadeOut()
    54.   {
    55.   if (!shouldFadeOut)
    56.   return;
    57.  
    58.   imageAlpha = Mathf.Lerp(imageAlpha, 0f, Time.deltaTime * 1.5f);
    59.  
    60.   if (imageAlpha <= 0.02f)
    61.   {
    62.   shouldFadeOut = false;
    63.   StartCoroutine(NextSponsor());
    64.   }
    65.   }
    66.  
    67.   IEnumerator NextSponsor()
    68.   {
    69.   yield return new WaitForSeconds(0.2f);
    70.   if ((currentSponsor + 1) < Sponsors.Length)
    71.   {
    72.   shouldFadeIn = true;
    73.   currentSponsor += 1;
    74.   }
    75.   else
    76.   {
    77.   reachEnd = true;
    78.   }
    79.   }
    80.  
    81.   void ShowImage()
    82.   {
    83.   GUI.depth = 0;
    84.   GUI.color = new Color(GUI.color.r, GUI.color.b, GUI.color.g, imageAlpha);
    85.   GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), Sponsors[currentSponsor], ScaleMode.ScaleToFit, true, 1.0F);
    86.   }
    87.  
    88.   void OnGUI()
    89.   {
    90.   if (Sponsors.Length > 0 && !reachEnd)
    91.   {
    92.   fadeIn();
    93.   ShowImage();
    94.   fadeOut();
    95.   }
    96.   }
    97. }
    98.  
    99.  
     
    blackbird, JouTaino45 and Haseeb_BSAA like this.
  33. JouTaino45

    JouTaino45

    Joined:
    Dec 26, 2014
    Posts:
    22
    You mean like a splash-screen?
     
    Stiffx likes this.
  34. Haseeb_BSAA

    Haseeb_BSAA

    Joined:
    Aug 20, 2014
    Posts:
    316
    God bless you with even more knowledge!!! Thank you for sharing it :)
     
    Stiffx likes this.
  35. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Yes indeed, but you can set a sequence of images

    Thank you :)
     
    Haseeb_BSAA likes this.
  36. JouTaino45

    JouTaino45

    Joined:
    Dec 26, 2014
    Posts:
    22
    Cool! Originally, I created two different scenes for two splash-screens for the game I am building, but whenever I debug it, it was slow. So I might try your method instead.
     
    Stiffx likes this.
  37. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Nice feel free to post your results and i hope the script helps
     
    JouTaino45 likes this.
  38. JouTaino45

    JouTaino45

    Joined:
    Dec 26, 2014
    Posts:
    22
    It works ! but I will have to modify this part of the code so the texture can fill the screen.
    Code (CSharp):
    1.  GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height),
     
    Stiffx likes this.
  39. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Very nice
     
    Haseeb_BSAA likes this.
  40. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    thank you very much man you are the best ! one question where i have to attach that script ? just to the camera ? that's mean in the intro ? or i can used it between two scenes?
     
    Stiffx likes this.
  41. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    You are very welcome.

    You can attach the script to any gameObject you want, if you have a scene called intro as you say, just attach it to the main camera and you'll be good to go.
     
    Haseeb_BSAA and blackbird like this.
  42. JouTaino45

    JouTaino45

    Joined:
    Dec 26, 2014
    Posts:
    22
    Any update from UT Asset Store?
     
    blackbird likes this.
  43. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    i think tomorrow it will be available
     
    JouTaino45 likes this.
  44. JouTaino45

    JouTaino45

    Joined:
    Dec 26, 2014
    Posts:
    22
    I hope so, I am actually on a deadline for a project. And this package will come in handy...
     
    Stiffx likes this.
  45. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Hi there guys, no news from UT, it could take up to Tuesday or Wednesday cause they said 3 business day. I've submitted the pack at Friday.
     
    Haseeb_BSAA and JouTaino45 like this.
  46. JouTaino45

    JouTaino45

    Joined:
    Dec 26, 2014
    Posts:
    22
    Haseeb_BSAA and Stiffx like this.
  47. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    no updates ?
     
  48. snackzilla

    snackzilla

    Joined:
    Aug 17, 2014
    Posts:
    91
    Any update on this asset? I've saved up and I'm waiting for it eagerly! :D
     
    Stiffx likes this.
  49. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Yes they asked to change the image key, i'm fixing it now. Thank you guys
     
  50. snackzilla

    snackzilla

    Joined:
    Aug 17, 2014
    Posts:
    91
    Great news! Will you have to re-submit and wait the three business days again? Or will they go ahead and just post it after you change the image key?
     
    Stiffx and JouTaino45 like this.